1.0.2 • Published 9 years ago
localtime v1.0.2
localtime
Generate localtime string with format that you defined.
Installation
npm i -S localtimeUsage
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:
YYYYMMDDhhmmss
You needn't use them all, like:
MM/DD hh:mmhh:mm YYYY-MM-DD- ...
All above formats are valid.
License
MIT