I need to generate a timestamp in NTP format in Python. Specifically, I need to calculate the number of seconds since 1st January 1900, as a 32-bit number. (NTP timestamps are actually 64 bits, with the other 32 bits representing fractions of seconds – I’m not worried about this part).
How should I go about doing this?
(note that
timedelta.total_seconds()is not available in python3)