0

I am using a machine vision camera and when the camera gets an image, it returns the timestamp (in nanoseconds). I converted the timestamp to DateTime format.

new_time_ns = 15545164216329
new_time_s = new_time_ns * 1.e-9 # convert to second
datetimeformat = datetime.fromtimestamp(new_time_s).strftime('%Y-%m-%d %H:%M:%S')

However datetimeformat returns 1970-01-01 05:54:41. When I ran the code, the real datetime was 2022-06-01 17:25:00 (ignore the seconds) How can I get the datetimeformat with the actual time when I record the video?

Dong-gyun Kim
  • 411
  • 5
  • 23
  • The real datetime that you use is actually 1654104300 in seconds. I think that your timestamp looks to be way off. Is the clock of the camera calibrated to match current NTP servers? – Akash Purandare Jun 01 '22 at 19:06
  • @AkashPurandare I think the camera does not consider the current NTP servers. But I am not sure about that. – Dong-gyun Kim Jun 02 '22 at 09:01

0 Answers0