2.0.2 • Published 4 years ago

lc-time-format v2.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

lc-time-format

Transfer date to custom formate.

usage

Pass a Date instance or a stander date string, and a formatter string, return a formatted time string.

import timeFormat from 'lc-time-format';
const formattedStr = timeFormat(
    new Date('2016', '8', '8', '5', '8', '7'),
    'YMD-HNS'
);
// or apply a date string
const formattedStr = timeFormat('Sep 08 2016 05:08:07 +8', 'YMD-HNS');
// 20160908-050807
Y -> 2016
y -> 16

M -> 09
m -> 9

D -> 08
d -> 8

H -> 05
h -> 5

N -> 08
n -> 8

S -> 07
s -> 7

License

MIT

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago