I am currently working on a project in which I have to find timestamps in multiple formated patterns.
The idea is to search time stamps in log files.
If successful _GetDateInString() will returns a timestamp in YYYY/MM/DD hh:mm:ss
Example:
_GetDateInString("...Process Last Run 17 JUN at 05:15...", "DD Mon at hh:mm")
will return 2014/06/17 05:15:00
Formats tested: - DDMonYY hh:mm:ss (matches dates like 30May14 03:59:59)
- DD Mon YYYY hh:mm - Mon, DD YYYY hh:mm:ss - Mon, D YYYY hh:mm:ss - DD Mon at hh:mm
- DMonYY hh:mm:ss - DMon hh:mm:ss - DD/MM/YYYY hh:mm - DD-MM-YYYY hh:mm
- DDMMYYYY hh:mm - DD/MM hh:mm - MM.DD.YYYY hh:mm - YYYYDDMM hh:mm
- YYYYMMDD - hh:mm - DD.MM hh:mm - D/M/YYYY hh:mm - D.M.YYYY hh:mm
- M.D.YY h:mm:ss - M.D.YY hh:mm - M.D.YY hh:mm - M.D.YYYY h:mm:ss
- M.D.YYYY h:mm:ss - M.D at h:mm:ss
and many other formats...
udf with examples:
_GetDateInString 1.0.0.1.au3
GreenCan