1.0.2 • Published 8 years ago

localtime v1.0.2

Weekly downloads
2
License
MIT
Repository
-
Last release
8 years ago

localtime

Generate localtime string with format that you defined.

Installation

npm i -S localtime

Usage

const localtime = require('localtime');

console.log(localtime());
console.log(localtime(undefined, 'YYYY-MM-DDThh-mm-ss'));
console.log(localtime('', 'YYYY-MM-DDThh-mm-ss'));
console.log(localtime('2016-11-08T01:57:16.642Z', 'YYYY/MM/DD hh:mm:ss'));

More details

The format is mard up with:

  • YYYY
  • MM
  • DD
  • hh
  • mm
  • ss

You needn't use them all, like:

  • MM/DD hh:mm
  • hh:mm YYYY-MM-DD
  • ...

All above formats are valid.

License

MIT