options
| 以下のプロパティの一部またはすべてを持つオブジェクトです。
dateStyle
- 日付の書式化スタイルを表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
full
| D: 「2020年10月5日月曜日」('ja', {dateStyle:'full'})
|
---|
long
| D: 「2020年10月5日」('ja', {dateStyle:'long'})
|
---|
medium
| D: 「2020/10/05」('ja', {dateStyle:'medium'})
|
---|
short
| D: 「2020/10/05」('ja', {dateStyle:'short'})
|
---|
このプロパティは timeStyle と一緒に使用することができますが、dayPeriod、weekday、era、year、month、day、hour、minute、second、fractionalSecondDigits、timeZoneName と一緒に使用できません。
timeStyle
- 時刻の書式化スタイルを表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
full
| D: 「19時23分30秒 日本標準時」('ja', {timeStyle:'full'})
|
---|
long
| D: 「19:23:30 JST」('ja', {timeStyle:'long'})
|
---|
medium
| D: 「19:23:30」('ja', {timeStyle:'medium'})
|
---|
short
| D: 「19:23」('ja', {timeStyle:'short'})
|
---|
このプロパティは dateStyle と一緒に使用することができますが、dayPeriod、weekday、era、year、month、day、hour、minute、second、fractionalSecondDigits、timeZoneName と一緒に使用することはできません。
calendar
- 暦を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
buddhist
| タイの仏教暦。
D: 「BE2563/10/5」('ja', {calendar:'buddhist'})
|
---|
chinese
| 古来の中国の暦。
D: 「庚子-8-19」('ja', {calendar:'chinese'})
|
---|
coptic
| 古来の韓国の暦コプト暦。
D: 「ERA11737/1/25」('ja', {calendar:'coptic'})
|
---|
¶dangi
| 古来の韓国の暦
|
---|
ethiopia
| エチオピア暦、アメテ・アレム(紀元前 5493 年頃)。
D: 「2020/10/5」('ja', {calendar:'ethiopia'})
|
---|
ethiopic
| エチオピア暦、Amete Mihret(エポック約、西暦 8 年)。
D: 「ERA12013/1/25」('ja', {calendar:'ethiopic'})
|
---|
gregory
| グレゴリオ暦。
D: 「2020/10/5」('ja', {calendar:'gregory'})
|
---|
hebrew
| 古来のヘブライ暦。
D: 「AM5781/1/17」('ja', {calendar:'hebrew'})
|
---|
indian
| インド暦。
D: 「サカ1942/7/13」('ja', {calendar:'indian'})
|
---|
islamic
| イスラム暦。
D: 「AH1442/2/18」('ja', {calendar:'islamic'})
|
---|
¶islamic-umalqura
| イスラム暦、ウンムアルクーラ。
|
---|
¶islamic-tbla
| イスラム暦、表形式(閏年[2、5、7、10、13、16、18、21、24、26、29] ― 天体暦)
|
---|
¶islamic-civil
| イスラム暦、表形式(閏年[2、5、7、10、13、16、18、21、24、26、29] ― 市民暦)
|
---|
¶islamic-rgsa
| イスラム暦、サウジアラビア地方
|
---|
iso8601
| ISO カレンダー (ISO 8601 カレンダーの曜日規則を使用したグレゴリオ暦)。
D: 「2020/10/5」('ja', {calendar:'iso8601'})
|
---|
japanese
| 日本の皇紀。
D: 「R2/10/5」('ja', {calendar:'japanese'})
|
---|
persian
| ペルシャ暦。
D: 「AP1399/7/14」('ja', {calendar:'persian'})
|
---|
roc
| 中華民国暦(中華民国)。
D: 「Taiwan109/10/5」('ja', {calendar:'roc'})
|
---|
¶islamicc
| シビル(アルゴリズム)アラビア暦
mdn: 警告: islamicc 暦は非推奨です。islamic-civil を使用してください。
|
---|
→locales の Unicode 拡張の ca からも利用できます。
dayPeriod
- 日単位の期間の表現の仕方を表す文字列。値は以下の何れか。
強制的に12時間制になるようです。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
long
|
D: 「夜」('ja', {dayPeriod:'long'})
D: 「in the evening」('en', {dayPeriod:'long'})
|
---|
short
|
D: 「夜」('ja', {dayPeriod:'short'})
D: 「in the evening」('en', {dayPeriod:'short'})
|
---|
narrow
|
D: 「夜」('ja', {dayPeriod:'narrow'})
D: 「in the evening」('en', {dayPeriod:'narrow'})
|
---|
numberingSystem
- 数字の表記法を表す文字列。値は以下の何れか。→Numbering System
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
arab
| アラビア・インド数字。
D: 「٢٠٢٠/١٠/٥」('ja', {numberingSystem:'arab'})
|
---|
finance
| 金融数字 ― アルゴリズムの場合あり
D: 「2020/10/5」('ja', {numberingSystem:'finance'})
|
---|
fullwide
| 全角数字。
D: 「2020/10/5」('ja', {numberingSystem:'fullwide'})
D: 「19:23:30 JST」('ja', {numberingSystem:'fullwide', timeStyle:'long'})
|
---|
¶grek
| 大文字のギリシャ数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'grek'})
|
---|
¶greklow
| 小文字のギリシャ数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'greklow'})
|
---|
¶hanidays
| 太陰暦またはその他の旧暦向けの漢字による日付の数字。
D: 「2020/10/5」('ja', {numberingSystem:'hanidays'})
|
---|
hanidec
| 漢数字。
D: 「二〇二〇/一〇/五」('ja', {numberingSystem:'hanidec'})
D: 「一九:二三:三〇 JST」('ja', {numberingSystem:'hanidec', timeStyle:'long'})
|
---|
¶hans
| 簡体字の漢数字 — アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'hans'})
|
---|
¶hansfin
| 簡体字の金融用漢数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'hansfin'})
|
---|
¶hant
| 繁体字の漢数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'hant'})
|
---|
¶hantfin
| 繁体字の金融用漢数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'hantfin'})
|
---|
¶jpan
| 日本語の漢数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'jpan'})
|
---|
¶jpanfin
| 日本語の金融用漢数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'jpanfin'})
|
---|
¶jpanyear
| 最初の年を元年とした日本の暦用の命数法。
D: 「2020/10/5」('ja', {numberingSystem:'jpanyear'})
|
---|
latn
| ラテン数字。
D: 「2020/10/5」('ja', {numberingSystem:'latn'})
|
---|
¶mathbold
| 数学的太数字。
D: 「𝟐𝟎𝟐𝟎/𝟏𝟎/𝟓」('ja', {numberingSystem:'mathbold'})
|
---|
¶mathdbl
| 数学的二重打鍵の数字。
D: 「𝟚𝟘𝟚𝟘/𝟙𝟘/𝟝」('ja', {numberingSystem:'mathdbl'})
|
---|
¶mathmono
| 数学的等幅数字。
D: 「𝟸𝟶𝟸𝟶/𝟷𝟶/𝟻」('ja', {numberingSystem:'mathmono'})
|
---|
¶mathsanb
| 数学的サンセリフ太字数字。
D: 「𝟮𝟬𝟮𝟬/𝟭𝟬/𝟱」('ja', {numberingSystem:'mathsanb'})
|
---|
¶mathsans
| 数学的サンセリフ数字。
D: 「𝟤𝟢𝟤𝟢/𝟣𝟢/𝟧」('ja', {numberingSystem:'mathsans'})
|
---|
¶native
| ネイティブの数字。
D: 「2020/10/5」('ja', {numberingSystem:'native'})
|
---|
¶roman
| 大文字のローマ数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'roman'})
|
---|
¶romanlow
| 小文字のローマ数字 ― アルゴリズム
D: 「2020/10/5」('ja', {numberingSystem:'romanlow'})
|
---|
¶traditio
| 伝統的な数字 ― アルゴリズムの場合あり
D: 「2020/10/5」('ja', {numberingSystem:'traditio'})
|
---|
→locales の Unicode 拡張の nu からも利用できます。
localeMatcher
- 使用するロケール照合アルゴリズムを表す文字列。値は以下の何れか。→Intl:マッチング アルゴリズム
timeZone
- 使用するタイムゾーンを表す文字列。値:
UTC 、のタイムゾーン名(「IANA タイムゾーン データベース」の「tzdata2022g.tar.gz」を解凍→theory.html)。
既定値は、実行時の既定¶のタイムゾーン。
値の例:
DA=new Intl.DateTimeFormat('ja', {timeZone:○○, timeStyle:'full'});
D=DA.format(new Date('2020-10-05T19:23:30'));
UTC
| 協定世界時。
D: 「10時23分30秒 協定世界時」('UTC')
|
---|
Asia/Tokyo
| 東京
D: 「19時23分30秒 日本標準時」('Asia/Tokyo')
|
---|
JST
| 日本標準時間
D: 「19時23分30秒 日本標準時」('JST')
|
---|
Japan
| 日本時間
D: 「19時23分30秒 日本標準時」('Japan')
|
---|
Asia/Shanghai
| 上海
D: 「18時23分30秒 中国標準時」('Asia/Shanghai')
|
---|
Asia/Kolkata
| カルカッタ
D: 「15時53分30秒 インド標準時」('Asia/Kolkata')
|
---|
America/New_York
| ニューヨーク
D: 「6時23分30秒 アメリカ東部夏時間」('America/New_York')
|
---|
hour12
- 24 時制ではなく 12 時制を使用するかどうかの論理値。既定ではロケールに依存します。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
true
|
D: 「2020/10/5」('ja', {hour12:true})
D: 「午後7:23:30 日本標準時」('ja', {hour12:true, timeStyle:'full'})
|
---|
false
|
D: 「19時23分30秒 日本標準時」('ja', {hour12:false, timeStyle:'full'})
|
---|
timeStyle の指定が必要のようです。
→locales の Unicode 拡張の hc からも利用できます。
hourCycle オプションと一緒に使用された場合、それを上書きします。
hourCycle
- 12/24時間制を表す文字列。値は以下の何れか。
このプロパティ単独だと日付が出てしまいます。timeStyle などで時刻部を指定する必要があるようです。
h11
| 12時間制ですが、0時は「0」から始まる。
DA=new Intl.DateTimeFormat('ja', {hourCycle:'h11'});
D=DA.format(new Date('2020-10-05T19:23:30')); //2020/10/5
DA=new Intl.DateTimeFormat('ja', {hourCycle:'h11', timeStyle:'full'});
D=DA.format(new Date('2020-10-05T19:23:30')); //午後7:23:30 日本標準時
D=DA.format(new Date('2020-10-05T00:23:30')); //午前0:23:30 日本標準時
|
---|
h12
| 12時間制ですが、0時は「12」から始まる。
DA=new Intl.DateTimeFormat('ja', {hourCycle:'h12', timeStyle:'full'});
D=DA.format(new Date('2020-10-05T19:23:30')); //午後7:23:30 日本標準時
D=DA.format(new Date('2020-10-05T00:23:30')); //午前12:23:30 日本標準時
|
---|
h23
| 24時間制ですが、0時は「0」から始まる。
DA=new Intl.DateTimeFormat('ja', {hourCycle:'h23', timeStyle:'full'});
D=DA.format(new Date('2020-10-05T19:23:30')); //19時23分30秒 日本標準時
D=DA.format(new Date('2020-10-05T00:23:30')); //0時23分30秒 日本標準時
|
---|
h24
| 24時間制ですが、0時は「24」から始まる。
DA=new Intl.DateTimeFormat('ja', {hourCycle:'h24', timeStyle:'full'});
D=DA.format(new Date('2020-10-05T19:23:30')); //19時23分30秒 日本標準時
D=DA.format(new Date('2020-10-05T00:23:30')); //24時23分30秒 日本標準時
|
---|
→locales の Unicode 拡張の nu からも利用できます。
formatMatcher
- 書式一致アルゴリズムを表す文字列。値は以下の何れか。
weekday
- 曜日の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
long
|
D: 「月曜日」('ja', {weekday:'long'})
D: 「Monday」('en', {weekday:'long'})
|
---|
short
|
D: 「月」('ja', {weekday:'short'})
D: 「Mon」('en', {weekday:'short'})
|
---|
narrow
|
D: 「月」('ja', {weekday:'narrow'})
D: 「M」('en', {weekday:'narrow'})
Tuesday、Thursday もこの形式では「T」です。
|
---|
timeStyle と一緒には指定できないようです。
era
- 時代の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2020-10-05T19:23:30'));
long
|
D: 「西暦2020/10/5」('ja', {era:'long'})
D: 「10/5/2020 Anno Domini」('en', {era:'long'})
|
---|
short
|
D: 「西暦2020/10/5」('ja', {era:'short'})
D: 「10/5/2020 AD」('en', {era:'short'})
|
---|
narrow
|
D: 「AD2020/10/5」('ja', {era:'narrow'})
D: 「10/5/2020 A」('en', {era:'narrow'})
|
---|
year
- 年の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T19:23:30'));
numeric
|
D: 「2021年」('ja', {year:'numeric'})
D: 「2021」('en', {year:'numeric'})
|
---|
2-digit
|
D: 「21年」('ja', {year:'2-digit'})
D: 「21」('en', {year:'2-digit'})
|
---|
month
- 月の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T19:23:30'));
numeric
|
D: 「10月」('ja', {month:'numeric'})
D: 「10」('en', {month:'numeric'})
|
---|
2-digit
|
D: 「10月」('ja', {month:'2-digit'})
D: 「10」('en', {month:'2-digit'})
|
---|
long
|
D: 「10月」('ja', {month:'long'})
D: 「October」('en', {month:'long'})
|
---|
short
|
D: 「10月」('ja', {month:'short'})
D: 「Oct」('en', {month:'short'})
|
---|
narrow
|
D: 「10月」('ja', {month:'narrow'})
D: 「O」('en', {month:'narrow'})
May、March は「M」となります。
|
---|
day
- 日の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T19:23:30'));
numeric
|
D: 「5日」('ja', {day:'numeric'})
D: 「5」('en', {day:'numeric'})
|
---|
2-digit
|
D: 「05日」('ja', {day:'2-digit'})
D: 「05」('en', {day:'2-digit'})
|
---|
hour
- 時の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T19:23:30'));
numeric
|
D: 「19時」('ja', {hour:'numeric'})
D: 「9時」('ja', {hour:'numeric'}、new Date('2021-10-05T09:23:30'))
D: 「7 PM」('en', {hour:'numeric'})
|
---|
2-digit
|
D: 「19時」('ja', {hour:'2-digit'})
D: 「09時」('ja', {hour:'2-digit'}、new Date('2021-10-05T09:23:30'))
D: 「07 PM」('en', {hour:'2-digit'})
|
---|
minute
- 分の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T19:23:30'));
numeric
|
D: 「23」('ja', {minute:'numeric'})
D: 「3」('ja', {minute:'numeric'}、new Date('2021-10-05T19:03:30'))
D: 「3」('en', {minute:'numeric'}、new Date('2021-10-05T19:03:30'))
D: 「19:03」('ja', {minute:'numeric', hour:'numeric'}、new Date('2021-10-05T19:03:30'))
D: 「9:03」('ja', {minute:'numeric', hour:'numeric'}、new Date('2021-10-05T09:03:30'))
|
---|
2-digit
|
D: 「3」('ja', {minute:'2-digit'}、new Date('2021-10-05T19:03:30'))
D: 「3」('en', {minute:'2-digit'}、new Date('2021-10-05T19:03:30'))
D: 「9:03」('ja', {minute:'2-digit', hour:'numeric'}、new Date('2021-10-05T09:03:30'))
|
---|
second
- 秒の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T09:03:05'));
numeric
|
D: 「5」('ja', {second:'numeric'})
D: 「5」('en', {second:'numeric'})
D: 「03:05」('ja', {second:'numeric', minute:'numeric'})
D: 「9時 (秒: 5)」('ja', {second:'numeric', hour:'numeric'})
D: 「9 AM (second: 5)」('en', {second:'numeric', hour:'numeric'})
D: 「9:03:05」('ja', {second:'numeric', hour:'numeric', minute:'numeric'})
|
---|
2-digit
|
D: 「5」('ja', {second:'2-digit'})
D: 「5」('en', {second:'2-digit'})
D: 「9時 (秒: 5)」('ja', {second:'2-digit', hour:'numeric'})
D: 「09時 (秒: 5)」('ja', {second:'2-digit', hour:'2-digit'})
|
---|
fractionalSecondDigits
- 秒の小数点以下を表すために使用される数字の桁数数値(その先の桁は切り捨てられます)。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T09:03:05.246'));
0
| 小数点以下は切り捨てる。¶エラー発生
|
---|
1
| 1桁。
D: 「2」('ja', {fractionalSecondDigits:1})
|
---|
2
| 2桁。
D: 「24」('ja', {fractionalSecondDigits:2})
|
---|
3
| 3桁。
D: 「246」('ja', {fractionalSecondDigits:3})
|
---|
timeZoneName
- タイムゾーン名の表現方法を表す文字列。値は以下の何れか。
DA=new Intl.DateTimeFormat(○○);
D=DA.format(new Date('2021-10-05T09:03:05'));
long
| 長い形式。
D: 「2021/10/5 日本標準時」('ja', {timeZoneName:'long'})
D: 「10/5/2021, Japan Standard Time」('en', {timeZoneName:'long'})
D: 「2021/10/5 インド標準時」('ja', {timeZoneName:'long',timeZone:'Asia/Kolkata'})
D: 「10/5/2021, India Standard Time」('en', {timeZoneName:'long',timeZone:'Asia/Kolkata'})
D: 「9時 日本標準時」('ja', {timeZoneName:'long', hour:'numeric'})
|
---|
short
| 短い形式。
D: 「2021/10/5 JST」('ja', {timeZoneName:'short'})
D: 「10/5/2021, GMT+9」('en', {timeZoneName:'short'})
D: 「2021/10/5 JST」('ja', {timeZoneName:'short'})
|
---|
longOffset
| 長い GMT 形式。
D: 「2021/10/5 GMT+09:00」('ja', {timeZoneName:'longOffset'})
D: 「2021/10/5 GMT+05:30」('ja', {timeZoneName:'longOffset',timeZone:'Asia/Kolkata'})
|
---|
shortOffset
| 短い GMT 形式。
D: 「2021/10/5 GMT+9」('ja', {timeZoneName:'shortOffset'})
D: 「10/5/2021, GMT+9」('en', {timeZoneName:'shortOffset'})
D: 「2021/10/5 GMT+5:30」('ja', {timeZoneName:'shortOffset',timeZone:'Asia/Kolkata'})
|
---|
longGeneric
| 一般的な場所を示す長い形式。
D: 「2021/10/5 日本標準時」('ja', {timeZoneName:'longGeneric'})
D: 「10/5/2021, Japan Standard Time」('en', {timeZoneName:'longGeneric'})
D: 「2021/10/5 インド標準時」('ja', {timeZoneName:'longGeneric',timeZone:'Asia/Kolkata'})
|
---|
shortGeneric
| 一般的な場所を示す短い形式。
D: 「2021/10/5 JST」('ja', {timeZoneName:'shortGeneric'})
D: 「10/5/2021, Japan Time」('en', {timeZoneName:'shortGeneric'})
D: 「2021/10/5 インド時間」('ja', {timeZoneName:'shortGeneric',timeZone:'Asia/Kolkata'})
|
---|
「日本標準時」「JST」「PST」「GMT-8」などの単独は得られないようです。
mdn: メモ: タイムゾーンの表示は、必要な文字列が利用できない場合、別の形式にフォールバックすることがあります。例えば、場所を指定しない形式では、"Pacific Time" のように特定の国や都市の場所を指定せずにタイムゾーンを表示する必要がありますが、"Los Angeles Time" のようなタイムゾーンにフォールバックする場合があります。
|
---|