java's System.nanoTime() seems to give a long: 1337203874231141000L while python time.time() will give something like 1337203880.462787
how can i convert time.time()'s value to something match up to System.nanoTime()?
Divide the output of System.nanoTime()
by 10^9. This is because it is in nanoseconds, while the output of time.time()
is in seconds.
Python documentation indicates that the time is epoch based in python. Java does as well. The problem is that python uses a float/double for time, while java uses an int.
I think it would be easier to convert to a standard format, then convert to the target system, rather then try to use the number of seconds since the epoch as you're trying to do.
You can't.
From the documentation: