Baseline Widely available
Intl.DateTimeFormat
ì ì¸ì´ì ë§ë ë ì§ ë° ìê° ììì ì ì©í기 ìí ê°ì²´ì
ëë¤.
const date = new Date(Date.UTC(2020, 11, 20, 3, 23, 16, 738));
// Results below assume UTC timezone - your results may vary
// Specify default date formatting for language (locale)
console.log(new Intl.DateTimeFormat("en-US").format(date));
// Expected output: "12/20/2020"
// Specify default date formatting for language with a fallback language (in this case Indonesian)
console.log(new Intl.DateTimeFormat(["ban", "id"]).format(date));
// Expected output: "20/12/2020"
// Specify date and time format using "style" options (i.e. full, long, medium, short)
console.log(
new Intl.DateTimeFormat("en-GB", {
dateStyle: "full",
timeStyle: "long",
timeZone: "Australia/Sydney",
}).format(date),
);
// Expected output: "Sunday, 20 December 2020 at 14:23:16 GMT+11"
ìì±ì
Intl.DateTimeFormat()
ìë¡ì´ Intl.DateTimeFormat
ê°ì²´ë¥¼ ìì±í©ëë¤.
Intl.DateTimeFormat.supportedLocalesOf()
매ê°ë³ìë¡ ì ê³µí ë¡ì¼ì¼ ëª©ë¡ ì¤, ë°íìì´ íì¬ ì§ìíë ë¡ì¼ì¼ í목ì ë°°ì´ë¡ ë°íí©ëë¤.
Intl.DateTimeFormat.prototype.format()
DateTimeFormat
ê°ì²´ì ë¡ì¼ì¼ê³¼ ìì ìµì
ì ë§ì¶° ë ì§ë¥¼ ììíí´ ë°íí©ëë¤.
Intl.DateTimeFormat.prototype.formatToParts()
ë ì§ ìì 문ìì´ì ê° ë¶ë¶ì ë¶í´íì¬ í í° ê°ì²´ë¡ ë§ë¤ê³ Array
ë¡ ë°íí©ëë¤. ë¡ì¼ì¼ì ë°ë¼ ë¤ë¥¸ ì¬ì©ì ì§ì ììì ì ì©í ë ì¬ì©í ì ììµëë¤.
Intl.DateTimeFormat.prototype.resolvedOptions()
DateTimeFormat
ê°ì²´ë¥¼ ì´ê¸°íí ë í ë¹ë ë¡ì¼ì¼ ë° ìì ìµì
ì ê³ì° ê°ì ëíë´ë ê°ì²´ë¥¼ ë°íí©ëë¤.
Intl.DateTimeFormat.prototype.formatRange()
ë ê°ì Dates를 ë°ì í, íì¬ í ë¹ë ë¡ì¼ì¼ê³¼ ìµì ë´ìì ê°ì¥ ê°ê²°í ííë¡ ë ë ì§ì ë²ì를 ëíë´ë 문ìì´ì ë°íí©ëë¤.
Intl.DateTimeFormat.prototype.formatRangeToParts()
ë ê°ì Dates를 ë°ì í, íì¬ í ë¹ë ë¡ì¼ì¼ê³¼ ìµì
ë´ìì ê°ì¥ ê°ê²°í ííë¡ ë ë ì§ì ë²ì를 ëíë´ë 문ìì´ì ìì±í©ëë¤. 문ìì´ì ê° ë¶ë¶ì ë¶í´íì¬ í í° ê°ì²´ë¡ ë§ë¤ê³ Array
ë¡ ë°íí©ëë¤.
DateTimeFormat
ì¬ì©í기
ë¡ì¼ì¼ì ì§ì íì§ ìê³ ì¬ì©íë©´ 기본 ë¡ì¼ì¼ê³¼ 기본 ìµì ì ììì ì ì©í 문ìì´ì ë°íí©ëë¤.
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
// 매ê°ë³ì ìì´ toLocaleString()ì í¸ì¶í ê²°ê³¼ë
// 구íì²´, 기본 ë¡ì¼ì¼, 기본 ìê°ëì ë¤ë¼ ë¬ë¼ì§
console.log(new Intl.DateTimeFormat().format(date));
// â ko-KR ë¡ì¼ì¼(ì¸ì´)ê³¼ Asia/Seoul ìê°ë(UTC+0900)ìì "2012. 12. 20."
ë¡ì¼ì¼ ì§ì í기
ë¤ì ìì ë ì§ìíë ì«ì ìì ë°©ë²ì ë³´ì¬ì¤ëë¤. ì¬ì©ìì ì¸ì´ì ì í©í ììì ì ì©íë ¤ë©´ locales
매ê°ë³ìë¡ í´ë¹ ì¸ì´(íìí ê²½ì° ëì²´ ì¸ì´ê¹ì§)를 ì ê³µíë 걸 ìì§ ë§ì¸ì.
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
// ìë ê²°ê³¼ë 모ë Asia/Seoul ìê°ë를 ì¬ì©í ê²°ê³¼ (UTC+0900, íêµ íì¤ì)
// íêµì´ìì ë ì§ í기ë ì°ìì¼ ìì
console.log(new Intl.DateTimeFormat("ko-KR").format(date));
// â "2012. 12. 20."
// ë¯¸êµ ìì´ìì ë ì§ í기ë ìì¼ë
ìì
console.log(new Intl.DateTimeFormat("en-US").format(date));
// â "12/20/2012"
// ìêµ ìì´ìì ë ì§ í기ë ì¼ìë
ìì
console.log(new Intl.DateTimeFormat("en-GB").format(date));
// â "20/12/2012"
// ëë¶ë¶ì ìëì´ êµê°ììë ì§ì§ ìë¼ë¹ì ì«ì ì¬ì©
console.log(new Intl.DateTimeFormat("ar-EG").format(date));
// â "Ù¢Ù â/١٢â/٢٠١٢"
// ì¼ë³¸ì´ì ê²½ì° ì´í리ì¼ì´ì
ì ì°í¸ë¥¼ ì¬ì©í´ì¼ í ìë ìì
// 2012ë
ì í¤ì´ì¸ì´ 24ë
console.log(new Intl.DateTimeFormat("ja-JP-u-ca-japanese").format(date));
// â "24/12/20"
// ë°ë¦¬ì´ì ê°ì´ ì§ìëì§ ìì ìë ìë ì¸ì´ë¥¼ ì§ì í ëë
// ë¤ìê³¼ ê°ì´ ëì²´ ì¸ì´ë¥¼ ì§ì í ì ìì. ìëì ê²½ì° ëì²´ ì¸ì´ë ì¸ëì´
console.log(new Intl.DateTimeFormat(["ban", "id"]).format(date));
// â "20/12/2012"
ìµì
ì§ì í기
options
매ê°ë³ì를 ì§ì íë©´ ë ì§ì ìê° ìì 결과를 ìíë ííë¡ ë°ê¿ ì ììµëë¤.
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
// 긴 ë ì§ ììì ëí´ ìì¼ ìì²
var options = {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
};
console.log(new Intl.DateTimeFormat("de-DE", options).format(date));
// â "Donnerstag, 20. Dezember 2012"
// ì´í리ì¼ì´ì
ì´ GMT를 ì¬ì©í´ì¼ íê³ , ê·¸ ì ì ëª
ìí´ì¼ í ë
options.timeZone = "UTC";
options.timeZoneName = "short";
console.log(new Intl.DateTimeFormat("en-US", options).format(date));
// â "Thursday, December 20, 2012, GMT"
// ì¢ ë ìì¸í ì¤ì ì´ íìíë©´
options = {
hour: "numeric",
minute: "numeric",
second: "numeric",
timeZone: "Australia/Sydney",
timeZoneName: "short",
};
console.log(new Intl.DateTimeFormat("en-AU", options).format(date));
// â "2:00:00 pm AEDT"
// 미êµììë 24ìê°ì ê° íìí ë
options = {
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric",
hour12: false,
timeZone: "America/Los_Angeles",
};
console.log(new Intl.DateTimeFormat("en-US", options).format(date));
// â "12/19/2012, 19:00:00"
// ìµì
ì ì§ì íë©´ì ë¡ì¼ì¼ì ë¸ë¼ì°ì 기본ê°ì ì¬ì©íê³ ì¶ì ë 'default' ì§ì
console.log(new Intl.DateTimeFormat("default", options).format(date));
// â "2012. 12. 19. 19ì 0ë¶ 0ì´"
// ì¤ì /ì¤í ìê° íìê° íìí ë
options = { hour: "numeric", dayPeriod: "short" };
console.log(new Intl.DateTimeFormat("en-US", options).format(date));
// â 10 at night
ëª
ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4