How can I calculate the datetime for these strings:
offline_dt = "Jan 31 23:01:43"offline_dt = "Feb 1 01:19:01" (there are 2 spaces between Feb
and 1)I tried this code, however I only the first one worked:
offline_dt = dt.datetime.strptime(offline,"%b %d %H:%M:%S")
You could convert double spaces into a single space before processing.
offline.replace(" ", " ")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With