Intl.DateTimeFormat
Input
Alternativ use
Intl.DateTimeFormat can also be used from Date.prototype.toLocaleString()
new Date("2022-04-24T19:00")
.toLocaleString(undefined)
4/24/2022, 7:00:00 PM
Output
dateStyle
{
dateStyle: "full"
}
Sunday, April 24, 2022
{
dateStyle: "long"
}
April 24, 2022
{
dateStyle: "medium"
}
Apr 24, 2022
{
dateStyle: "short"
}
4/24/22
timeStyle
{
timeStyle: "full"
}
7:00:00 PM Coordinated Universal Time
{
timeStyle: "long"
}
7:00:00 PM UTC
{
timeStyle: "medium"
}
7:00:00 PM
{
timeStyle: "short"
}
7:00 PM
year
{
year: "numeric"
}
2022
{
year: "2-digit"
}
22
month
{
month: "numeric"
}
4
{
month: "2-digit"
}
04
{
month: "long"
}
April
{
month: "short"
}
Apr
{
month: "narrow"
}
A
day
{
day: "numeric"
}
24
{
day: "2-digit"
}
24
hour
{
hour: "numeric"
}
7 PM
{
hour: "2-digit"
}
07 PM
minute
{
minute: "numeric"
}
0
{
minute: "2-digit"
}
0
second
{
second: "numeric"
}
0
{
second: "2-digit"
}
0
weekday
{
weekday: "long"
}
Sunday
{
weekday: "short"
}
Sun
{
weekday: "narrow"
}
S
era
{
era: "long"
}
4/24/2022 Anno Domini
{
era: "short"
}
4/24/2022 AD
{
era: "narrow"
}
4/24/2022 A
hour12
{
hour12: true
}
7:00:00 PM
{
hour12: false
}
19:00:00
hourCycle
{
hourCycle: "h11"
}
7:00:00 PM
{
hourCycle: "h12"
}
7:00:00 PM
{
hourCycle: "h23"
}
19:00:00
{
hourCycle: "h24"
}
19:00:00
dayPeriod
{
dayPeriod: "long"
}
in the evening
{
dayPeriod: "short"
}
in the evening
{
dayPeriod: "narrow"
}
in the evening
fractionalSecondDigits
{
fractionalSecondDigits: 1
}
0.0
{
fractionalSecondDigits: 2
}
0.00
{
fractionalSecondDigits: 3
}
0.000
calendar
{
calendar: "buddhist"
}
4/24/2565 BE
{
calendar: "chinese"
}
2022-03-24
{
calendar: "coptic"
}
8/16/1738 ERA1
{
calendar: "ethiopia"
}
4/24/2022
{
calendar: "ethiopic"
}
8/16/2014 ERA1
{
calendar: "gregory"
}
4/24/2022
{
calendar: "hebrew"
}
23 Nisan 5782
{
calendar: "indian"
}
2/4/1944 Saka
{
calendar: "islamic"
}
9/23/1443 AH
{
calendar: "iso8601"
}
4/24/2022
{
calendar: "japanese"
}
4/24/4 R
{
calendar: "persian"
}
2/4/1401 AP
{
calendar: "roc"
}
4/24/111 Minguo
numberingSystem
{
numberingSystem: "arab"
}
٤/٢٤/٢٠٢٢
{
numberingSystem: "arabext"
}
۴/۲۴/۲۰۲۲
{
numberingSystem: "bali"
}
᭔/᭒᭔/᭒᭐᭒᭒
{
numberingSystem: "beng"
}
৪/২৪/২০২২
{
numberingSystem: "deva"
}
४/२४/२०२२
{
numberingSystem: "fullwide"
}
4/24/2022
{
numberingSystem: "gujr"
}
૪/૨૪/૨૦૨૨
{
numberingSystem: "guru"
}
੪/੨੪/੨੦੨੨
{
numberingSystem: "hanidec"
}
四/二四/二〇二二
{
numberingSystem: "khmr"
}
៤/២៤/២០២២
{
numberingSystem: "knda"
}
೪/೨೪/೨೦೨೨
{
numberingSystem: "laoo"
}
໔/໒໔/໒໐໒໒
{
numberingSystem: "latn"
}
4/24/2022
{
numberingSystem: "limb"
}
᥊/᥈᥊/᥈᥆᥈᥈
{
numberingSystem: "mlym"
}
൪/൨൪/൨൦൨൨
{
numberingSystem: "mong"
}
᠔/᠒᠔/᠒᠐᠒᠒
{
numberingSystem: "mymr"
}
၄/၂၄/၂၀၂၂
{
numberingSystem: "orya"
}
୪/୨୪/୨୦୨୨
{
numberingSystem: "tamldec"
}
௪/௨௪/௨௦௨௨
{
numberingSystem: "telu"
}
౪/౨౪/౨౦౨౨
{
numberingSystem: "thai"
}
๔/๒๔/๒๐๒๒
{
numberingSystem: "tibt"
}
༤/༢༤/༢༠༢༢
timeZoneName
{
timeZoneName: "long"
}
4/24/2022, Coordinated Universal Time
{
timeZoneName: "short"
}
4/24/2022, UTC
{
timeZoneName: "shortOffset"
}
4/24/2022, GMT
{
timeZoneName: "longOffset"
}
4/24/2022, GMT
{
timeZoneName: "shortGeneric"
}
4/24/2022, GMT
{
timeZoneName: "longGeneric"
}
4/24/2022, GMT
formatMatcher
{
formatMatcher: "best fit"
}
4/24/2022
{
formatMatcher: "basic"
}
4/24/2022
localeMatcher
{
localeMatcher: "best fit"
}
4/24/2022
{
localeMatcher: "lookup"
}
4/24/2022