date_time_formatter_ts
Description
Date time formatter for typescript
Installation
$ npm install date_time_formatter_ts
Usage
Format options
Option | Description |
---|---|
d |
Date |
dd |
Date with leading zero |
ddd |
First three letters of day of week |
dddd |
Full name for day of week |
m |
Month |
mm |
Month with leading zero |
mmm |
First three letters of the month. |
mmmm |
Month's full name. |
yy |
Year as last two digits |
yyyy |
Full Year. |
h |
Hours (12-hour clock). |
hh |
Hours with leading zero (12-hour clock). |
H |
Hours (24 hour) |
HH |
Hours with leading zero (24 hour) |
M |
Minutes |
MM |
Minutes with leading zero |
N |
Day of Week. Ex. Monday is 1 |
o |
Time zone offset string |
s |
Seconds |
ss |
Seconds with leading zero |
S |
st, nd, rd, or th |
l |
3 digit Milliseconds |
L |
2 digit Milliseconds |
t |
a or p. |
tt |
am or pm. |
T |
A or P. |
TT |
AM or PM. |
W |
Current week in the year |
... |
Surround text with this to print directly in the string |
Localization of text
You can use the following to change names for days and months for your area.
dateTimeFormatter.i18n.texts =