freeCodeCamp/guide/chinese/javascript/standard-objects/date/date-now/index.md

24 lines
379 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Date Now
localeTitle: 现在日期
---
## 现在日期
Date.now方法返回自1970年1月1日00:00:00 UTC以来经过的毫秒数。
### 句法
```js
var timeInMs = Date.now();
```
### 例
```js
Date.now();
// 1508783660969
```
#### 更多信息:
[MDN文档](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now)