Skip to content

Commit

Permalink
Merge pull request #649 from praekeltfoundation/migrate-to-turn-scripts
Browse files Browse the repository at this point in the history
Clean datetime string
  • Loading branch information
erikh360 authored Jan 14, 2025
2 parents 0867b98 + 836fc6a commit 0a5d0ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/migrate_to_turn/process_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def is_datetime(date):


def process_datetime(value):
if not value:
return

value = value.replace("Z", "").split("+")[0]
if is_datetime(value):
value = datetime.fromisoformat(value)
value = value.astimezone(pytz.utc).isoformat()
Expand Down

0 comments on commit 0a5d0ee

Please sign in to comment.