1.0.3 • Published 7 years ago

to-datetime v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 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

7 years ago

1.0.2

7 years ago

1.0.1

9 years ago

1.0.0

9 years ago