I have a CSV file like this:
2021-08-09 15:50:44 38962 part-00000-6baa0883-5212-49f7-9ba2-63a352211fdd-c000.snappy.parquet
2021-08-09 16:50:44 38962 part-00000-6baa0883-5212-49f7-9ba2-63a352211fdd-c000.snappy.parquet
I'd like to extract all the timestamps into one list so that I can perform the evaluation function below (ie evaluating if check_timestamps_updated
is true).
Problem is also taking the date into account, not just the time. What's the most efficient way of combining the two separate columns (date and time) from the csvreader object
so that it can be compared with control_time
?
from datetime import datetime as dt
control_time = str(str(dt.now()))
reader = csv.reader(results, delimiter=" ")
time_column = list(zip(*reader))[1]
check_timestamps_updated = all(i >= control_time for i in time_column)