Skip to content

Commit

Permalink
docs(stdlib/date): fixed #269
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Feb 24, 2024
1 parent a132886 commit 3a7a19a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/stdlib/date.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,15 @@ d.toTimeString() // "00:00:00 GMT+0800 (CST)"
var d = new Date(2013, 0, 1);

d.toLocaleString()
// 中文版浏览器为"2013年1月1日 上午12:00:00"
// 中文版浏览器为"2013/1/1 00:00:00"
// 英文版浏览器为"1/1/2013 12:00:00 AM"

d.toLocaleDateString()
// 中文版浏览器为"2013年1月1日"
// 中文版浏览器为"2013/1/1"
// 英文版浏览器为"1/1/2013"

d.toLocaleTimeString()
// 中文版浏览器为"上午12:00:00"
// 中文版浏览器为"00:00:00"
// 英文版浏览器为"12:00:00 AM"
```

Expand All @@ -343,13 +343,13 @@ dateObj.toLocaleTimeString([locales[, options]])
var d = new Date(2013, 0, 1);

d.toLocaleString('en-US') // "1/1/2013, 12:00:00 AM"
d.toLocaleString('zh-CN') // "2013/1/1 上午12:00:00"
d.toLocaleString('zh-CN') // "2013/1/1 00:00:00"

d.toLocaleDateString('en-US') // "1/1/2013"
d.toLocaleDateString('zh-CN') // "2013/1/1"

d.toLocaleTimeString('en-US') // "12:00:00 AM"
d.toLocaleTimeString('zh-CN') // "上午12:00:00"
d.toLocaleTimeString('zh-CN') // "00:00:00"
```

`options`配置对象有以下属性。
Expand Down

0 comments on commit 3a7a19a

Please sign in to comment.