asammdf icon indicating copy to clipboard operation
asammdf copied to clipboard

start_time Function Returning Date Out of Standard Format

Open MatheusFreitas25 opened this issue 1 year ago • 1 comments
trafficstars

Python version

('python=3.11.2 (v3.11.2:878ead1ac1, Feb 7 2023, 10:02:41) [Clang 13.0.0 ' '(clang-1300.0.29.30)]') 'os=macOS-14.0-arm64-arm-64bit' 'numpy=1.26.4' 'asammdf=7.3.16'

MDF version

4.10

Code snippet

mdf_start_time = mdf.start_time print(mdf_start_time) -> 2024-04-17 11:21:39+02:00 start_time_utc = mdf_start_time.astimezone(pytz.utc) print(start_time_utc) -> 2024-04-17 09:21:39+00:00

Description

We have an MF4 file where the Data date/time in the header is:

Data date/time: 17.04.2024 13:09:32

When running the above code, I find that the start time is:

2024-04-17 11:21:39+02:00

where I believe the minute 21 is the first signal record (perhaps).

The issue is that following the ISO 8601 standard, Python and other languages will interpret this date as UTC:

2024-04-17 09:21:39+00:00

So, I believe that in reality, the start time should return:

2024-04-17 13:21:39+02:00

And when converted to UTC, it would be:

2024-04-17 11:21:39+00:00

MatheusFreitas25 avatar May 08 '24 13:05 MatheusFreitas25

@MatheusFreitas25 there were some changes merged, please try again with the development branch code

danielhrisca avatar Jul 30 '24 07:07 danielhrisca