热卖商品
新闻详情
Intl.DateTimeFormat - 前端开发,前端技术分享-编织未来-前端开发...
来自 : www.fdbtech.com/?p=1...
发布时间:2021-03-25
locale ,DateTimeFormat locale options
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));// locale console.log(new Intl.DateTimeFormat().format(date));// 12/19/2012locales
locales
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));// (America/Los_Angeles for the US)// (US English) month-day-year console.log(new Intl.DateTimeFormat( en-US ).format(date));// 12/19/2012 // (British English) day-month-year console.log(new Intl.DateTimeFormat( en-GB ).format(date));// 20/12/2012 // year-month-day console.log(new Intl.DateTimeFormat( ko-KR ).format(date));// 2012. 12. 20. // (real Arabic digits)console.log(new Intl.DateTimeFormat( ar-EG ).format(date));// / / //2012 24 , 1989 1 8 console.log(new Intl.DateTimeFormat( ja-JP-u-ca-japanese ).format(date));// 24/12/20 // (ban) (id) // (id)console.log(new Intl.DateTimeFormat([ ban , id ]).format(date));// 20/12/2012options
options
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));// (options) (weekday) (long)var options = { weekday: long , year: numeric , month: long , day: numeric };console.log(new Intl.DateTimeFormat( de-DE , options).format(date));// Donnerstag, 20. Dezember 2012 // (UTC), UTC (short) options.timeZone = UTC options.timeZoneName = short // GMT console.log(new Intl.DateTimeFormat( en-US , options).format(date));// Thursday, December 20, 2012, GMT options = { hour: numeric , minute: numeric , second: numeric , 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: falseconsole.log(date.toLocaleString( en-US , options));// 12/19/2012, 19:00:00
本文链接: http://basstechintl.immuno-online.com/view-732246.html
发布于 : 2021-03-25
阅读(0)
最新动态
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
品牌分类
Others
联络我们