time-key

0.3.0 • Public • Published

time-key

NPM Version NPM Downloads Build Status Coveralls NPM License

Time Key

Install

npm install time-key --save

Useage

var timekey = require('time-key');
var timestamp = require('time-stamp');
var key = timekey('YYYYMMDDHH');
console.log(key.key()); // 2016061112
console.log(timestamp('YYYY/MM/DD HH:mm:ss:ms', new Date(key.ttl))); // 2016/06/11 13:00:00:00
 
// after 1 hour
console.log(key.key()); // 2016061113
console.log(timestamp('YYYY/MM/DD HH:mm:ss:ms', new Date(key.ttl))); // 2016/06/11 14:00:00:00

Readme

Keywords

Package Sidebar

Install

npm i time-key

Weekly Downloads

9

Version

0.3.0

License

MIT

Unpacked Size

5.22 kB

Total Files

3

Last publish

Collaborators

  • bacra