Repository navigation
Commit 783b902
committed
blf: interpret object timestamps as signed 64-bit values
Change BLF object header timestamp fields from uint64 (Q)
to int64 (q) for both V1 and V2 object headers.
Observed CANape-generated BLF files containing messages
before the recording start timestamp. When interpreted as
unsigned values, these timestamps wrap around and appear
approximately 2^64 ns in the future, resulting in invalid
timestamps (e.g. year 2611) and NaT values in pandas.
Using signed 64-bit timestamps correctly preserves negative
recording-relative offsets while still providing a usable
range of approximately ±292 years at nanosecond resolution.
Root cause:
A timestamp of -60 s was decoded as
2^64 ns - 60 s
which produced timestamps approximately 584 years in the
future. The resulting values exceeded the valid pandas
datetime range and appeared as NaT.1 parent b4f82ab commit 783b902
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments