Easydate
get date and/or time by pattern.
A simple date and time util that returns the date according to a pattern, easydate
takes two arguments, first one being a pattern string
and second one being an config object.
Pattern Options:
Y
Full year (number - e.g.2012
)y
Year (number - e.g.12
)M
Month (number - e.g.11
)d
Day (number - e.g.28
)h
Hour (number - e.g.02
)m
Minute (number - e.g.01
)s
Second (number - e.g.33
)l
Millisecond (number - e.g.001
)z
Timezone (string - e.g.UTC
,UTC+1
,UTC-11
)x
DST (string - either'DST'
or''
)
Config options:
1 2 3 4 5 |
|
Install it: npm install --save easydate
Sample usage:
1 2 3 4 5 6 7 8 9 10 |
|
GIF FTW!
Thanks to Rory Bradford for this handy util.