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

Readme

Keywords

Package Sidebar

Install

npm i lc-time-format

Weekly Downloads

1

Version

2.0.2

License

MIT

Unpacked Size

8.02 kB

Total Files

9

Last publish

Collaborators

  • elantion