npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

to-datetime

1.0.3 • Public • Published

to-datetime

Extremely simple and small module that formats a Date instance as datetime.

$ toDatetime(); // 2016-03-20 13:37:00

Installing

npm i to-datetime --save

Usage

var toDateTime = require ('to-datetime');
 
// From an instance
var date = new Date();
 
toDateTime(date);
 
// As UTC
toDateTime(date, true);
 
// From a constructor string
var dateString = new Date('2016-03-20 15:51:55');
toDateTime(dateString);
 
// Current time as datetime
toDateTime();
 
// Current time as UTC
toDateTime(null, true);

Running the tests

npm test

install

npm i to-datetime

Downloadsweekly downloads

1

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability