Skip to content

Commit

Permalink
Update generate_image_metadata.py
Browse files Browse the repository at this point in the history
add docstring
  • Loading branch information
frankinspace authored Jul 29, 2024
1 parent 9c97fbc commit 77d566c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bignbit/generate_image_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,19 @@ def extract_granule_dates(granule_umm_json: dict) -> (str, str, str, str):


def parse_datetime(datetime_str: str) -> datetime:
"""
Parses a datetime string into a datetime object.
Parameters
----------
datetime_str
Datetime in str format to parse
Returns
-------
datetime
a datetime object
"""
try:
return datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%S.%fZ")
except ValueError:
Expand Down

0 comments on commit 77d566c

Please sign in to comment.