I aim to convert
stringtime = '2020-02-30 10:27:00+01:00' so that I can compare it to
nowtime = datetime.datetime.utcnow() using
if nowtime > stringtime: print(1) I tried strptime:
datetime.datetime.strptime(stringtime, '%Y-%m-%d %H:%M:%S') But cannot find a format specification for the timezone in the strptime documentation.
I also tried
pandas.Timestamp(stringtime) but I get ValueError: could not convert string to Timestamp.
How can this be done?