Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

Binary data to date/time stamp, unable to find the proper conversion using Python

$
0
0

First post, long time lurker, couldn't get the format the way I wanted it to be. -sorry

I'm trying to convert part of a binary file to a date/time (in Python). But whatever I try I'm unable to find the proper conversion.

My guess is that the left byte (0x30) is not part of the data, and the remaining 8 bytes contain the relevant data.

Below are the binary parts, both in decimal and in Hex, and the date/time they represent. Any help is highly appreciated.

48  101 26  235 227 242 150 197 6530  65  1a  eb  e3  f2  96  c5  41    -- should read as 16 December 2023 at 15:0348  198 54  133 112 138 151 197 6530  c6  36  85  70  8a  97  c5  41   -- should read as 17 December 2023 at 12:3748  74  38  27  107 41  116 196 6530  4a  26  1b  6b  29  74  c4  41   -- should read as 1 October 2022 at 12:49

I've tried to unpack the data as either double or long long int and then obtain a date from it. I've searched the site and tried chat GPT to no avail.

Extra sample data

30  23  84  b1  a8  b5  97  c5  41 : 17 December 2023 at 18:4530  3f  91  e7  96  b5  97  c5  41 : 17 December 2023 at 18:45 (slightly later)30  a6  d6  2f  d1  b5  97  c5  41 : 17 December 2023 at 18:4630  e8  16  9c  b9  b5  97  c5  41 : 17 December 2023 at 18:47

Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>