javascript - How To Create a Timestamp In JavaScript
问题描述
I need to create a Timestamp like below. I have tried lots of ways , but couldn't get this format.
How can I create a current time and date in this Timestamp format in JavaScript ??
2018-08-20T04:19:50.670Z
解决方案
尝试这个
console.log(new Date().toISOString());
推荐阅读
- javascript - 模态图像库滑块全屏
- python - python将字符串转换为逻辑门函数
- amazon-web-services - 如何配置我的 RDS postgresql 实例以便我可以与我的 API 服务器 EC2 ubuntu 机器进行交互?
- javascript - 根据 ${selectedcount} 显示不同的输出
- android - 如何阻止机器人使用谷歌登录?
- magento - 如何将 Magento 网站从一台服务器转移到另一台服务器
- c++ - 运算符重载使用运算符 + 为类模板添加
- exception - 异常向量是中断向量的更好名称吗?(在 ARM 的上下文中)
- swift - SwiftUI NavigationLink - “懒惰”的目的地?或者如何不编码重复的“标签”?
- c - 我从一位同事那里看到了一些有趣的代码。我很困惑发生了什么。它是哪个标准?我没能在 GOOGLE 中找到答案