Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Bugfix Time format for all versions in mcafee #864

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ayushlimaye
Copy link
Contributor

@ayushlimaye ayushlimaye commented Jul 16, 2022

  • Update version number
  • Created function to parse date and scan status and update accordingly.

Current problem : dd/mm/yy and mm/dd/yy can not be seperated for example

05/01/2022 will result in 01/05/2022 when put in dd/mm/yy (which will be read as Jan 5) and
05/01/2022 will result in 05/01/2022 when put in mm/dd/yy (which will be read as Jan 5) and

All the cases supported by this regex :

(?:\w{3}\s\w{3,}\s+\d{1,2}\s+\d\d:\d\d:\d\d\s\d{4})|(?:\w{3}\s+\d{1,2}\s+\w{3}\s+\d{4}\s+\d\d:\d\d:\d\d\s+((AM|PM|am|pm))\s+UTC)|(?:\d{1,4}[/-]\d{1,2}[/-]\d{1,4}\s\d\d:\d\d:\d\d(\s)((AM|PM|am|pm))(\s)(UTC|(-\d{4}))*)

"%a %b %d %H:%M:%S %Y" -> Tue Jan 12 08:42:20 2020
"%a %b %-d %H:%M:%S %Y" -> Tue Jan 2 08:42:20 2020

"%a %d %b %Y %H:%M:%S %p %Z" -> Wed 22 Jun 2022 01:00:01 AM UTC
"%a %e %b %Y %H:%M:%S %p %Z" -> Wed 2 Jun 2022 01:00:01 AM UTC
"%a %d %b %Y %H:%M:%S %P %Z" -> Wed 22 Jun 2022 01:00:01 am UTC
"%a %e %b %Y %H:%M:%S %P %Z" -> Wed 2 Jun 2022 01:00:01 am UTC

"%d/%m/%y %H:%M:%S %Z" -> 09/01/17 07:43:09 UTC
"%e/%-m/%y %H:%M:%S %Z" -> 9/1/17 07:43:09 UTC
"%d/%m/%y %H:%M:%S %z" -> 09/01/17 07:43:09 -0800
"%e/%-m/%y %H:%M:%S %z" -> 9/1/17 07:43:09 -0800
"%m/%d/%y %H:%M:%S %Z" -> 01/09/17 07:43:09 UTC
"%-m/%e/%y %H:%M:%S %Z" -> 1/9/17 07:43:09 UTC
"%m/%d/%y %H:%M:%S %z" -> 01/09/17 07:43:09 -0800
"%e/%-m/%y %H:%M:%S %z" -> 1/9/17 07:43:09 -0800
"%y/%m/%d %H:%M:%S %Z" -> 17/09/01 07:43:09 UTC
"%y/%-m/%e %H:%M:%S %Z", -> 17/9/1 07:43:09 UTC
"%y/%m/%d %H:%M:%S %z", -> 17/09/01 07:43:09 -0800
"%y/%-m/%e %H:%M:%S %z" -> 17/9/1 07:43:09 -0800

"%d/%m/%Y %H:%M:%S %Z" -> 09/01/2017 07:43:09 UTC
"%e/%-m/%Y %H:%M:%S %Z" -> 9/1/2017 07:43:09 UTC
"%d/%m/%Y %H:%M:%S %z" -> 09/01/2017 07:43:09 -0800
"%e/%-m/%Y %H:%M:%S %z" -> 9/1/2017 07:43:09 -0800
"%m/%d/%Y %H:%M:%S %Z" -> 01/09/2017 07:43:09 UTC
"%-m/%e/%Y %H:%M:%S %Z" -> 1/9/2017 07:43:09 UTC
"%m/%d/%Y %H:%M:%S %z" -> 01/09/2017 07:43:09 -0800
"%e/%-m/%Y %H:%M:%S %z" -> 1/9/2017 07:43:09 -0800
"%Y/%m/%d %H:%M:%S %Z" -> 2017/09/01 07:43:09 UTC
"%Y/%-m/%e %H:%M:%S %Z", -> 2017/9/1 07:43:09 UTC
"%Y/%m/%d %H:%M:%S %z", -> 2017/09/01 07:43:09 -0800
"%Y/%-m/%e %H:%M:%S %z" -> 2017/9/1 07:43:09 -0800

"%d-%m-%y %H:%M:%S %Z" -> 09-01-17 07:43:09 UTC
"%e-%-m-%y %H:%M:%S %Z" -> 9-1-17 07:43:09 UTC
"%d-%m-%y %H:%M:%S %z" -> 09-01-17 07:43:09 -0800
"%e-%-m-%y %H:%M:%S %z" -> 9-1-17 07:43:09 -0800
"%m-%d-%y %H:%M:%S %Z" -> 01-09-17 07:43:09 UTC
"%-m-%e-%y %H:%M:%S %Z" -> 1-9-17 07:43:09 UTC
"%m-%d-%y %H:%M:%S %z" -> 01-09-17 07:43:09 -0800
"%e-%-m-%y %H:%M:%S %z" -> 1-9-17 07:43:09 -0800
"%y-%m-%d %H:%M:%S %Z" -> 17-09-01 07:43:09 UTC
"%y-%-m-%e %H:%M:%S %Z", -> 17-9-1 07:43:09 UTC
"%y-%m-%d %H:%M:%S %z", -> 17-09-01 07:43:09 -0800
"%y-%-m-%e %H:%M:%S %z" -> 17-9-1 07:43:09 -0800

"%d-%m-%Y %H:%M:%S %Z" -> 09-01-2017 07:43:09 UTC
"%e-%-m-%Y %H:%M:%S %Z" -> 9-1-2017 07:43:09 UTC
"%d-%m-%Y %H:%M:%S %z" -> 09-01-2017 07:43:09 -0800
"%e-%-m-%Y %H:%M:%S %z" -> 9-1-2017 07:43:09 -0800
"%m-%d-%Y %H:%M:%S %Z" -> 01-09-2017 07:43:09 UTC
"%-m-%e-%Y %H:%M:%S %Z" -> 1-9-2017 07:43:09 UTC
"%m-%d-%Y %H:%M:%S %z" -> 01-09-2017 07:43:09 -0800
"%e-%-m-%Y %H:%M:%S %z" -> 1-9-2017 07:43:09 -0800
"%Y-%m-%d %H:%M:%S %Z" -> 2017-09-01 07:43:09 UTC
"%Y-%-m-%e %H:%M:%S %Z", -> 2017-9-1 07:43:09 UTC
"%Y-%m-%d %H:%M:%S %z", -> 2017-09-01 07:43:09 -0800
"%Y-%-m-%e %H:%M:%S %z" -> 2017-9-1 07:43:09 -0800

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant