Skip to content

Commit

Permalink
Merge branch 'development' into cli-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JessyBarrette committed Aug 15, 2023
2 parents 3cf7094 + d997e9b commit cff678a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocean_data_parser/parsers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ def get_spatial_coverage_attributes(
return ds


def convert_datetime_str(time_str, **to_datetime_kwargs):
def convert_datetime_str(time_str:str, **to_datetime_kwargs) -> pd.Timestamp:
"""Parse time stamp string to a pandas Timestamp"""
date_format = None
if time_str is None:
return pd.NaT

if re.fullmatch(r"\d\d\d\d-\d\d-\d\d", time_str):
date_format = "%Y-%m-%d"
elif re.fullmatch(r"\d\d-\d\d-\d\d\d\d", time_str):
Expand Down

0 comments on commit cff678a

Please sign in to comment.