|
|
|
|
|
by user982
2299 days ago
|
|
A line in one of my Python daemons has been crashing it repeatedly all day: isotime = datetime.strptime(time.get('title'), '%a %d %b %I:%M:%S %p').replace(year=YEAR, tzinfo=TZ).isoformat()
ValueError: day is out of range for month
It's not mission-critical, so I'm just going to wait it out until tomorrow.EDIT: Hacked it out. isotime = datetime.strptime(f"{time.get('title')} {YEAR} {tzoffset:+03d}00", '%a %d %b %I:%M:%S %p %Y %z').isoformat()
|
|