Change datetime fields to date fields in BagInfoMetadata model. #634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is for Issue #506
After updating the date_start and date_end fields in the BagInfoMetadata model from
to
and running a migration, the date was being saved as one day earlier than what was in the bag-info file.
Transfer's Bag Info:
External Identifier: records-2017-12-11T20:09:48.238148
BagIt-Profile-Identifier: http://localhost:8000/api/bagit_profiles/2/
Bagging-Date: 2017-12-11T20:09:48.238148
Date-End: 2005-06-22
Date-Start: 2003-05-14
The Transfer's data through the Django shell after being imported:
Inside of the Transfer's detail view:
After reading @helrond comment about timezone/daylight, I started to take a look around and saw that
config.py
has the time zone set as America/New_York on line 15.Updating this value to UTC allowed for the
date_field
to save correctly.Transfer's Bag Info:
External Identifier: records-2017-12-11T20:09:48.238148
BagIt-Profile-Identifier: http://localhost:8000/api/bagit_profiles/2/
Bagging-Date: 2017-12-11T20:09:48.238148
Date-End: 2005-06-22
Date-Start: 2003-05-14
The Transfer's data through the Django shell after
DJANGO_TIME_ZONE
was updated:Inside of the Transfer's detail view:
Side Note:
This update to the
DJANGO_TIME_ZONE
also seems to fix thebagging_date
time being fives hours off of its value in bag-data.