mIRC Homepage

$ctime(string).gmt

Posted By: maroon

$ctime(string).gmt - 03/10/19 02:40 PM

Related to $gmt(N) in this thread, would it be possible to have $ctime(date string) either recognize strings UTC or GMT, or have a .gmt .prop, which allows recognizing the date string as being a GMT time instead of local time?

//var -s %a Feb 29 2008 , 12:00:00 GMT , %b $ctime(%a) , %c $asctime(%b) , %d $gmt(%b)
//var -s %a Jul 29 2008 , 12:00:00 UTC , %b $ctime(%a) , %c $asctime(%b) , %d $gmt(%b)

$ctime(date string) is applying the correct daylight offset for the datestring. It ignores the GMT or UTC, so, but it can be complicated to obtain the correct N if %a is a UTC timestamp instead of local, without knowing how many hours to adjust the N in %a, depending on which time of the year the timestamp resides.

After the proposed fix, the example below should return N's being values which have zero remainder after dividing by 86400 regardless of the date or timezone rules.

//var -s %winter $ctime(1970-01-01 00:00:00) , %sb_zero %winter % 86400 , %summer $ctime(1970-06-01 00:00:00) , %sb_zero %summer % 86400
© 2020 mIRC Discussion Forums