I'm parsing datetimestamps using python dateutil, but would like to avoid the extra dependency. So Is there a way to do the equivalent with the standard python library:
dateutil.parser.parse("2012-12-12T12:00")
Thanks a lot!
I'm parsing datetimestamps using python dateutil, but would like to avoid the extra dependency. So Is there a way to do the equivalent with the standard python library:
dateutil.parser.parse("2012-12-12T12:00")
Thanks a lot!
If your date strings are all in the same format, you could use strptime like this:
In [31]: import datetime as DT
In [32]: DT.datetime.strptime("2012-12-12T12:00", '%Y-%m-%dT%H:%M')
Out[32]: datetime.datetime(2012, 12, 12, 12, 0)
© 2022 - 2024 — McMap. All rights reserved.
strptime
? – Bottomry