Skip to content

Commit 4c366a9

Browse files
committed
fix datetime
1 parent e4b3732 commit 4c366a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

neo/rawio/plexon2rawio/plexon2rawio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def _parse_header(self):
157157
Source = namedtuple("Source", "id name sampling_rate n_samples")
158158
for c in range(self.pl2reader.pl2_file_info.m_TotalNumberOfAnalogChannels):
159159
achannel_info = self.pl2reader.pl2_get_analog_channel_info(c)
160-
161160
# only consider active channels
162161
if not achannel_info.m_ChannelEnabled:
163162
continue
@@ -273,8 +272,10 @@ def _parse_header(self):
273272
# python is 1..12 https://docs.python.org/3/library/datetime.html#datetime.datetime
274273
# so month needs to be tm_mon+1; also tm_sec could cause problems in the case of leap
275274
# seconds, but this is harder to defend against.
275+
year = tmo.tm_year # This has base 1900 in the c++ struct specification so we need to add 1900
276+
year += 1900
276277
dt = datetime(
277-
year=tmo.tm_year,
278+
year=year,
278279
month=tmo.tm_mon + 1,
279280
day=tmo.tm_mday,
280281
hour=tmo.tm_hour,
@@ -328,7 +329,6 @@ def _parse_header(self):
328329
"m_OneBasedChannelInTrode",
329330
"m_Source",
330331
"m_Channel",
331-
"m_Name",
332332
"m_MaximumNumberOfFragments",
333333
]
334334

0 commit comments

Comments
 (0)