Spaces:
Sleeping
Sleeping
File size: 997 Bytes
3b86501 8ebe686 3b86501 8ebe686 3b86501 8ebe686 3b86501 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import csv
from datetime import datetime
def load_csv_to_dict(filename):
"""Loads a CSV file into a list of dictionaries."""
with open(filename, mode='r', newline='', encoding='utf-8') as file:
# Create a DictReader object
dict_reader = csv.DictReader(file)
# Convert DictReader to a list of dictionaries
data_list = list(dict_reader)
return data_list
#def get_stringified_date(date):
# """
# Gets a date like 2024-04-09T19:29:38.072017Z and returns the day
# """
# return str(datetime.strptime(date, "%Y-%m-%dT%H:%M:%S.%fZ").date())
def compare_date_with_today(input_date:datetime):
# Parse the input date string
#input_date = datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%S.%fZ")
# Get today's date (without time component)
today_date = datetime.now().date()
# Compare the input date's date component with today's date
if input_date.date() == today_date:
return True
else:
return False
|