0

Python

import time
round(time.time()*1000)

JS

new Date().getTime()

Are both of these same or local timezone dependent (as mentioned here)? I'm getting the almost same result (manually testing in console and IDE). But don't know, if the result will change if my timezone changes.

Dr.PB
  • 959
  • 1
  • 13
  • 34

1 Answers1

0

From the documentation of python's time library https://docs.python.org/3/library/time.html so time.time() for python returns the floating point number from Jan 1, 1970 whereas JS getTime() returns the time from Jan 1, 1970. The output with both will be different but you can get the same value from python as the JS one by converting it which in your case you have done.

Trideep
  • 51
  • 8