ceate excel for herd and livestock
This commit is contained in:
@@ -308,6 +308,10 @@ def convert_str_to_date(string):
|
||||
return datetime.strptime(string, '%Y-%m-%dT%H:%M:%S.%fZ').date()
|
||||
except ValueError:
|
||||
try:
|
||||
return datetime.strptime(string, '%Y-%m-%d').date()
|
||||
return datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ').date() # Added format without milliseconds
|
||||
except ValueError:
|
||||
return None
|
||||
try:
|
||||
return datetime.strptime(string, '%Y-%m-%d').date()
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user