Closed markorapaic closed 8 years ago
Also, when I try:
get_ref_date = parse(row[15]).midnight()
print(get_ref_date)
I get:
TypeError: 'datetime.datetime' object is not callable
I've since had another look at the documentation and have realised that midnight is not a function, but a property. I've changed this:
get_ref_date = parse(row[15]).midnight
However I still get the value error:
ValueError: String does not contain a date.
what is row[15]
I've ended up resolving this - the CSV I was looping through ended up having a field - row[15]
- where I was expecting a date, but there actually was no date, hence it returned a value of None
which is why the ValueError: String does not contain a date
message was displayed (as it should!). User error, slightly embarrassed to be honest.
@markorapaic This happens, shake it off. Been far more embarrassed in the past just be courteous when someone inevitably does it to you! :100:
I'm trying to parse a string
row[15]
using the parse function, and then convert the result to midnight, and then convert that to epoch, however it keeps coming back with:TypeError: 'datetime.datetime' object is not callable
What am I doing wrong, and is it possible to do the above? Ideally i'd like to be able to get it to show milliseconds too...