在前端获取UTC时间戳的方法 发表于 2020-09-11 评论数: 12345678910111213function getUtcTimestamp() { const now = new Date(); const utcTimestamp = Date.UTC( now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds() ); return `${parseInt(utcTimestamp / 1000, 10)}`;} ET碎碎念,每周一,晚六点一刻更新,欢迎订阅 打赏 微信支付 支付宝 比特币 本文作者: ety001 本文链接: https://akawa.ink/2020/09/10/get-utc-timestamp-on-the-frontend.html 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!