# Unix 时间戳 (秒)

URL: https://caijiao.org/dayjs/parse/unix-timestamp
Source: docs/dayjs/parse/unix-timestamp.md
Description: 解析传入的一个 Unix 时间戳 (10 位数字，从 1970 年 1 月 1 日 Utc 午夜开始所经过的秒数) 创建一个 Day.js 对象。

解析传入的一个 Unix 时间戳 (10 位数字，从 1970 年 1 月 1 日 Utc 午夜开始所经过的秒数) 创建一个 [Day.js](/dayjs/) 对象。

```javascript
dayjs.unix(1318781876);
```

这个方法是用 `dayjs( timestamp * 1000)` 实现的，所以传入时间戳里的小数点后面的秒也会被解析。

```javascript
dayjs.unix(1318781876.721);
```
