changed date
This commit is contained in:
@@ -6,7 +6,6 @@ from datetime import datetime
|
||||
|
||||
|
||||
def convert_to_machine_readable(date_string):
|
||||
print(f"converting {date_string}")
|
||||
# Define the format string considering the time zone information (EDT)
|
||||
format_string = "%a %b %d %H:%M:%S %p %Z %Y"
|
||||
try:
|
||||
@@ -14,9 +13,11 @@ def convert_to_machine_readable(date_string):
|
||||
datetime_obj = datetime.strptime(date_string, format_string)
|
||||
return datetime_obj
|
||||
except ValueError:
|
||||
print(f"given: {date_string}")
|
||||
print(
|
||||
f"Error: Invalid date format. Please provide a string in the format '{format_string}'."
|
||||
)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user