Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 python 中,我可以time.time()用来得到这个:
time.time()
time = time.time() time = 1362914221
我如何在 java 脚本中得到这个?
time = ????
您可以使用
time = (new Date()).getTime() / 1000;
请参阅MDN 上的 getTime()。
像这样:
var time = +new Date;