Skip to content

Aimeejs/time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time

Install

aimee i time --save

Usage

var Time = require('time');

console.log(Time.now()) // => 2016-07-29 14:50:51
var time = new Time;

time.now()              // => 2016-07-29 14:50:51
time.get()              // => 2016-07-29 14:50:51
time.get(1469775764290) // => 2016-07-29 15:02:44

time.now('[hh:mm]')     // => [14:50]
time.now('[hh:mm:ss]')  // => [14:50:51]
time.get(1469775764290, '[hh:mm:ss]')   // => [15:02:44]
var time = new Time({ format: '[hh:mm]' });

time.now()              // => [14:50]
time.now('[hh:mm:ss]')  // => [14:50:51]
time.now('[yyyy-MM-dd]')// => [2016-07-29]
time.get()              // => [14:50]
time.get(1469775764290) // => [15:02]

Full Format String

yyyy-MM-dd hh:mm:ss.SSS

About

time format 时间格式化

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published