简体   繁体   中英

What is difference between javascript and python time stamp?

I have this javascript code:

(new Date()).getTime()

And this python code:

time.time()

The first one return some thing like 1410072754803 but the python return something like 1410077369.27 i need the python to return same format as javascript does.How can i get that?

PS:if i use

time.time() * 1000

it return :

1.41007799536e+12

One returns milli seconds, while other returns seconds in float.

Python equivalent of javascript timestamp would be.

jts = int(time.time()*1000)

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