mIRC Homepage
Posted By: westor $asctime "problem" - 01/05/14 09:59 PM
I saw something strange while i use $asctime, check this it might not be an bug but i cannot understand why not return GMT and return GMP or GMA in sometimes, ok the solution is to use zzz on timezone and not z.

example: //echo $asctime($ctime(Thu $+ $chr(44) 01 May 2014 20:16:25 GMT),dd/mmm/yy HH:nn:ss z GMT)

output: 01/May/14 20:16:25 +3 GMP

example2: //echo $asctime($ctime(Thu $+ $chr(44) 01 May 2014 20:16:25 GMT),dd/mmm/yy HH:nn:ss zzz gmt)

output: 01/May/14 20:16:25 +0300 GMT g5p

- Thanks!
Posted By: drum Re: $asctime "problem" - 02/05/14 01:06 AM
'm' is replaced with the month number (5=May). 't' is replaced by 'a' or 'p' for AM or PM. 'T' does the same but with a capital letter.
Posted By: westor Re: $asctime "problem" - 02/05/14 02:14 PM
Originally Posted By: drum
'm' is replaced with the month number (5=May). 't' is replaced by 'a' or 'p' for AM or PM. 'T' does the same but with a capital letter.


Yes.. and?? i know the usage of $asctime but here the output is wrong in timezone and not in other details.
Posted By: Loki12583 Re: $asctime "problem" - 02/05/14 02:38 PM
You obviously don't know the usage, because you're passing the strings GMT and gmt and they're converted to exactly what they're supposed to be. Neither $ctime nor $asctime take timezone abbreviations as inputs.
Posted By: drum Re: $asctime "problem" - 07/05/14 02:00 AM
Originally Posted By: westor
Originally Posted By: drum
'm' is replaced with the month number (5=May). 't' is replaced by 'a' or 'p' for AM or PM. 'T' does the same but with a capital letter.


Yes.. and?? i know the usage of $asctime but here the output is wrong in timezone and not in other details.


The point is that the text "GMT" is not interpreted as a timezone in the script examples that you gave us. It's interpreted as three letters, G which has no meaning and left unaltered, M which is replaced by the numeric month, and T which is replaced with A or P depending on the time of day.

$asctime does not provide a means to convert between timezones, if that is what you are trying to accomplish.

If you want the text to remain literal, don't include it inside $asctime().
Posted By: westor Re: $asctime "problem" - 07/05/14 08:35 PM
Aha ok i have understand now.

- Thanks!
© mIRC Discussion Forums