pangaea-data-publisher / pangaeapy

PANGAEA Python Client
https://www.pangaea.de/
GNU General Public License v3.0
29 stars 18 forks source link

Date/Time field not read correctly if format does not exactly match #58

Closed ajutila closed 3 weeks ago

ajutila commented 10 months ago

Hi there!

I think the fix for #53 still fails, when the Date/Time format doesn't strictly follow the given format of '%Y-%m-%dT%H:%M:%S'

I have been playing with https://doi.org/10.1594/PANGAEA.924668, i.e. 10-minute averages of Polarstern tracks, where timestamps are given to the minute, not to the second.

Since PANGAEA follows the ISO8601 standard, and so does pandas (https://pandas.pydata.org/docs/reference/api/pandas.to_datetime.html), could the format parameter in pandataset.py be replaced with 'ISO8601' to enable parsing any ISO8601 time string and not only those that have the time down to seconds? Quick test on my own computer would suggest so, but perhaps wider testing is needed.

huberrob commented 9 months ago

Excellent suggestion, thanks!