Skip to content

Commit

Permalink
Add more date formats for auto-parsing/correction
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Jul 22, 2024
1 parent 63a019b commit 38ae8d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yara_validator/validator_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"%Y/%m/%d", "%y/%m/%d",
"%Y.%d.%m", "%y.%d.%m",
"%Y.%m.%d", "%y.%m.%d",
"%Y%d%m", "%y%d%m",
"%Y%m%d", "%y%m%d",
"%d-%m-%Y", "%m-%d-%Y", "%m-%d-%y", "%Y-%m-%d",
"%d.%m.%Y", "%m.%d.%Y", "%m.%d.%y", "%Y.%m.%d",
"%f/%e/%Y", "%f/%e/%y", "%e/%f/%Y", "%e/%f/%y",
Expand Down Expand Up @@ -99,6 +101,8 @@ def convert_date(date):
return True, parsed_date.strftime("%Y-%m-%d")
except ValueError:
continue
except Exception:
continue
return False, date


Expand Down

0 comments on commit 38ae8d6

Please sign in to comment.