mIRC Home    About    Download    Register    News    Help

Print Thread
#245681 01/05/14 09:59 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
'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.

drum #245684 02/05/14 02:14 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
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().

drum #245783 07/05/14 08:35 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Aha ok i have understand now.

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard