-1

I need to create a timestamp that follows the same notation as a regular timestamp except it's reference time starts from 01/01/2000 being time zero.

1 Answers1

0

I assume a "regular timestamp" should be seconds since?

import datetime
(datetime.datetime.now()-datetime.datetime(2000, 1, 1)).total_seconds()
paul
  • 408
  • 2
  • 8
  • Yeah that works! How would I get nanoseconds with this as well? – carolineodeluce Jun 07 '19 at 18:15
  • The solution provides milliseconds precision. datetime does not support more than this, as do obviously most OS and hardware platforms AFAIK. See https://stackoverflow.com/a/10612166/1522205 – paul Jun 07 '19 at 20:05