Closed btrd closed 2 years ago
My solution to this problem :
cell = self.data[1, 1].value
try:
time = datetime.strptime(cell, "%Y-%m-%dT%H:%M:%S")
except ValueError:
try:
time = datetime.strptime(cell, "%Y-%m-%d")
except ValueError:
#not a date
self.data[x, 0].set_value(time.hour)
I have to read a column of date/time, if I read the date "15/07/2014 23:00:00" there is no problem I get
2014-07-15T23:00:00
. But if I read15/07/2014 00:00:00
, I get2014-07-15
instead of2014-07-15T00:00:00
. I lose the time.