0

I got a starting timestamp of 14813.501476 which translated to epoch unix time is GMT: Thursday, January 1, 1970 4:06:53.501 AM. I got a duration in ms which is 539,161999999124 or about half a second.

Now I wanted to find out what the time is when adding this half a second to the timestamp, like this:

14813.501476 + 539.161999999124

but it adds up to 15377.599602999124 or GMT: Thursday, January 1, 1970 4:16:17.599 AM which is mere 10 minutes to much.

I'm obviously messing up the decimal here but I seem too be to stupid to figure out how to fix this issue.

1
  • Have you tried timedelta as shown here
    – vahdet
    Apr 20, 2018 at 11:31

1 Answer 1

0

Just do:

14813.501476 + (539.161999999124/ 1000)

See Pyfiddle

The duration has miliseconds units and the timestamp has seconds units.

1
  • Ah, thanks! I actually did try this but when I checked the time, it was still wrong so that is why I asked! Now I tried it again and this time it looked correct.
    – hulle
    Apr 20, 2018 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.