1.0.3 • Published 6 years ago

to-datetime v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

8 years ago

1.0.0

8 years ago