Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion neo/rawio/plexon2rawio/plexon2rawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ def _parse_header(self):
# invalid datetime information if year is <1
if tmo.tm_year != 0:
microseconds = block_info['m_CreatorDateTimeMilliseconds'] * 1000
dt = datetime(year=tmo.tm_year, month=tmo.tm_mon, day=tmo.tm_mday, hour=tmo.tm_hour,
# tm_mon range is 0..11 https://cplusplus.com/reference/ctime/tm/
# python is 1..12 https://docs.python.org/3/library/datetime.html#datetime.datetime
# so month needs to be tm_mon+1; also tm_sec could cause problems in the case of leap
# seconds, but this is harder to defend against.
dt = datetime(year=tmo.tm_year, month=tmo.tm_mon+1, day=tmo.tm_mday, hour=tmo.tm_hour,
minute=tmo.tm_min, second=tmo.tm_sec, microsecond=microseconds)
# ignoring daylight saving time information for now as timezone is unknown

Expand Down