0.0.4 • Published 3 years ago

date-to-string-js v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

dateToStringJS

DateToString is a zero dependency package, it take's two arguments, a date object and generic string that rappresent the desired format. Return a string with the same format as the second argument but filled with the Date values.

Installation

npm i date-to-string-js

Usage

const { dateToString } = require('date-to-string-js');
const myDate = new Date();

dateToString(myDate, 'DD/MM/YY'); // return 25/11/20
dateToString(myDate, 'DD/MM/YYYY'); // return 25/11/2020
dateToString(myDate, 'MM/DD/YYYY'); // return 11/25/2020
dateToString(myDate, 'DD-MM-YYYY hh:mm'); // return 25-11-2020 21:42
dateToString(myDate, 'hh:mm:ss'); // return 21:42:54
0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago