Skip to content

Commit 0439148

Browse files
authored
Merge pull request wangdoc#35 from itellboy/master
docs(stdlib): edit date
2 parents 2c1f76e + 884edf5 commit 0439148

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/stdlib/date.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,18 @@ d.toLocaleTimeString()
327327
// 英文版浏览器为"12:00:00 AM"
328328
```
329329

330+
**(9)Date.prototype.toLocaleString()**
331+
332+
`toLocaleString`方法返回一个字符串,代表时间的当地写法。
333+
334+
```javascript
335+
var d = new Date(2013, 0, 1);
336+
337+
d.toLocaleString()
338+
// 中文版浏览器为"2013年1月1日 上午12:00:00"
339+
// 英文版浏览器为"1/1/2013 12:00:00 AM"
340+
```
341+
330342
### get 类方法
331343

332344
`Date`对象提供了一系列`get*`方法,用来获取实例对象某个方面的值。

0 commit comments

Comments
 (0)