0.0.7 • Published 7 years ago

time-schema-formatter v0.0.7

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

a tool for transferring timestamp to standard time format

Date

NameDescriptionExample
YYYYYear2017
MMMonth02
DDDate01
hhHour23
mmMinute01
ssSecond02

Above is time-schema-formatter supported format. You can make your own time format. For example:

  • YYYY/MM/DD hh:mm:ss | 2017/06/07 23:01:02
  • YYYY年MM月DD日 hh-mm-ss | 2017年06月07日 23-01-02
  • YYYY-MM-DD | 2017-06-07

Usage

import timeFormat from 'time-schema-formatter'

// 2017/06/09 23:01:02
timeFormat({
 time: Date.parse(new Date()),
 format: 'YYYY/MM/DD hh:mm:ss',
});

// 2017年06月09日 23-01-02
timeFormat({
 time: Date.parse(new Date()),
 format: 'YYYY年MM月DD日 hh-mm-ss',
});

// 2017-06-09
timeFormat({
 time: Date.parse(new Date()),
 format: 'YYYY-MM-DD',
});
0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago