I want to compare two date and times with each other and then use that information for other stuff. Like if delta > 23 hours do this, elif delta > 11 hours, do that etc. I thought this would be a reasonable way to write it, but python won't accept it! It says:
ValueError: 'h' is a bad directive in format '%m/%d/%Y%h:%m:%s'
Isn't h the standard way to write hours in Python? :o
My dates are written in this format: "12/28/13 16:49:19", "m/d/y h:m:s" if that's any help!
from datetime import datetime
date_format = "%m/%d/%Y%h:%m:%s"
then=(dictionary["date"])
now= time.strftime("%c")
a = datetime.strptime(str(then), date_format)
b = datetime.strptime(str(now), date_format)
delta = b - a
print(delta.hour)