Nodeschool Public Materials
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

datetime-utc-local

1.0.1 • Public • Published

datetime-utc-local

npm

UTC or local time in YYYY/MM/DD-HH:mm:ss format

Installation

npm install datetime-utc-local

Usage

var DateTimeUTC = require('datetime-utc-local').utc;
var DateTimeLocal = require('datetime-utc-local').local;
 
console.log(DateTimeUTC());     // current UTC time
console.log(DateTimeLocal());   // current local time
console.log(DateTimeUTC(new Date(2018, 0, 1, 0, 0, 0)));    // 2017/12/31-23:00:00
console.log(DateTimeLocal(new Date(2018, 0, 1, 0, 0, 0)));  // 2018/01/01-00:00:00

License

MIT

Install

npm i datetime-utc-local

DownloadsWeekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.73 kB

Total Files

4

Last publish

Collaborators

  • avatar