简体   繁体   中英

Javascript render timestap

I want to render a unix timestamp into a readable format without my browser taking account for my timezone.

So say the timestamp is 1400167800 (05 / 15 / 14 @ 3:30:00pm UTC), and my timezone is +2. How can I render this timestamp as '15:30' instead of '17:30'?

使用moment.js在UTC时区中呈现值。

简单

var date = new Date().toUTCString();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM