This is what I believe I learned from fuzzing $ctime() with innumerous date/time strings.

Basically mIRC just reads from left-to-right trying to identify any date/time parts that it comes across, then fills in an internal variable for that given part.
Upon further inspection, mIRC performs at least 3 distinct passes to parse different values, so I'll segment this in order of those passes.
The order of these passes determines which time date parts will be overwritten if they occur twice in the string.

Any portion of the time and date can appear in ANY order, as long as all internal variables are filled (h m s optional).
Any portion of the time and date can appear multiple times, and it will overwrite previous values,

Quote
Internal variables are: Month, Date, Year, Hour, Minute, Second

Pass 1
If we encounter a number from 1 to 31, update our DATE variable.
If we encounter a number from 32 to 99 or 1601 to 9999, update our YEAR variable.
* years 32 to 99 are assumed 1900's.

Pass 2
If either structure d/d/d or d-d-d is encountered, as in 1/1/1 or 29-2-28
the center number is always the month,
try the left number as the day and the right number as the year,
if that's an invalid calendar date, then try the left number as the year and the right number as the day,
* years 39 to 99 are assumed 1900's and years 0 through 38 are 2000's.

Pass 2.5
If we encounter a d:d:d or d:d structure, treat it as h:m:s or h:m and update the HOUR, MINUTE and SECONDS variables.
If we encounter "pm" or "PM" (but no periods) then add 12 to the HOUR variable if it's less-than 12.
* (am and AM are just ignored)

Pass 3
If we encounter the first 3 letters of a month, ignore the rest of the spelling and update our MONTH variable.

Incidentals:

Random words that aren't touching are ignored. Day-Of-Week are ignored. "am" and "AM" are ignored in Pass 2.
The ordinal suffixes "st", "nd", "rd", "th" that are touching a 1 to 2 digit number are stripped and ignored in Pass 1.
Zero padding is stripped and ignored. Any number anywhere can be ridiculously zero-padded.
xxx However, any other random characters that prefix or suffix a number will invalidate the function.
/* This should probably be fixed --- that would solve a host a formatting issues, like comma usage.
You could strip and ignore random suffixing characters like you do with ordinals st nd rd th. */

Example: 02 1/1/1 Feb 01:23 Apricot 2019 pm
Result: Sun Apr 01 13:23:00 2001


Is that correct?

Last edited by Raccoon; 12/11/19 10:39 PM.