lc-time-format
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.20latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.20
2.0.10
2.0.00
1.0.81
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.21
1.0.11
1.0.00

Package Sidebar

Install

npm i lc-time-format

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

8.02 kB

Total Files

9

Last publish

Collaborators

  • elantion