Skip to content

FIX/Keep time zone info written in METADATA/creationDate

Karim Ahmed requested to merge fix/keep_time_zone_info into master

Description

This issue was discovered while investigating updating detector mapping for AGIPD@SPB.

After taking data for AGIPD@SPB and trying to test new modified mapping it was using 1 hour older creation_time.

How Has This Been Tested?

  1. This was tested with AGIPD_Retrieve_Constants_Precorrection.ipynb notebook to check that we have the same output format with extra zone info.

  2. And was tested with max-exfl017 as it has new mapping changes at 2021-03-01 09:44:00 UTC or 2021-03-01 10:44:00 CET

>> import datetime
>> c = datetime.datetime.strptime("2021301T094400Z", "%Y%m%dT%H%M%SZ")

2021-03-01 09:44:00

After preserving the timezone.

>> import datetime
>> c = datetime.datetime.strptime("2021301T094400Z", "%Y%m%dT%H%M%SZ").replace(tzinfo=datetime.timezone.utc)

2021-03-01 09:44:00+00:00

Relevant Documents (optional)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.

Reviewers

@manettim @danilevc @hammerd @roscar

Edited by Karim Ahmed

Merge request reports