File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,11 @@ def check_session_start_time_old_date(nwbfile: NWBFile):
2828 """
2929 session_start_time = nwbfile .session_start_time
3030 dummy_time = datetime (1980 , 1 , 1 )
31- if session_start_time .tzinfo is not None :
32- dummy_time = dummy_time .astimezone ()
31+
32+ tzinfo = session_start_time .tzinfo
33+ if tzinfo is not None :
34+ dummy_time = dummy_time .astimezone (tzinfo )
35+
3336 if session_start_time <= dummy_time :
3437 return InspectorMessage (
3538 message = (f"The session_start_time ({ session_start_time } ) may not be set to the true date of the recording." )
@@ -45,8 +48,10 @@ def check_session_start_time_future_date(nwbfile: NWBFile):
4548 """
4649 session_start_time = nwbfile .session_start_time
4750 current_time = datetime .now ()
51+ tzinfo = session_start_time .tzinfo
4852 if session_start_time .tzinfo is not None :
49- current_time = current_time .astimezone ()
53+ current_time = current_time .astimezone (tzinfo )
54+
5055 if session_start_time >= current_time :
5156 return InspectorMessage (
5257 message = f"The session_start_time ({ session_start_time } ) is set to a future date and time."
You can’t perform that action at this time.
0 commit comments