将Java时间戳代码与JavaScript匹配
我有这段代码,显示将时间戳设置为用
Java 编写的特定格式:
timeStamp = System.currentTimeMillis();
writer.write(String.format("%d, %f, %s\n", timeStamp, evt.values[1], otherstr ));
我正在使用 javascript,所以我需要翻译它。
我目前有这样的问题:
const timeStamp = + new Date();
console.log(timeStamp);
我无法测试 Java,因为我不了解 Java,所以我在这里询问。
我的 javascript 代码与 Java 时间戳匹配吗?
如果没有,我怎样才能在Javascript中匹配它?
I have this code which showing sets the timestamp to be in a specific format written in
Java:
timeStamp = System.currentTimeMillis();
writer.write(String.format("%d, %f, %s\n", timeStamp, evt.values[1], otherstr ));
I am using javascript so I need to translate it.
I currently have this:
const timeStamp = + new Date();
console.log(timeStamp);
I can't test the Java one as I don't know Java so I'm asking here.
Would my javascript code match the Java timestamp?
If not, how can I match it in Javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论