js linux时间戳
时间: 2023-08-21 09:07:11 浏览: 152
回答: 在JavaScript中,可以使用以下代码将Linux时间戳转换为标准的时间格式:
```
var CrDate = new Date();
CrDate.setTime(date); // 其中date为需要被转化的Linux时间戳1490778706000
var createDate = CrDate.toLocaleString(); // 被转换为标准的时间格式2017/3/29 下午5:11:46
```
<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [JavaScript中linux时间戳与日期的转换](https://blog.csdn.net/biang1212/article/details/69802310)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [linux 时间戳](https://blog.csdn.net/weixin_39905725/article/details/116778456)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文