mIRC Home    About    Download    Register    News    Help

Print Thread
Certain Location Time Script? #256512 23/01/16 03:58 PM
Joined: Sep 2015
Posts: 8
N
Nordy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: Sep 2015
Posts: 8
Hello :-) Is there any way to add a specific time zone that shows what time it is somewhere? Like:

03:25 pm GMT

to

4:27 am SST

Code:
On *:text:!time:#:{
  msg # $time(hh:nn tt) ?timezone?
}


Thanks

Re: Certain Location Time Script? [Re: Nordy] #256513 23/01/16 06:57 PM
Joined: Dec 2015
Posts: 148
Dazuz Offline
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
I feel obligated to say that time zones are a pain in the ass, but yes that's definitely possible.

You can use $gmt identifier and then add/take hours from it as you please. As an example I live in Finland, and currently our offset is UTC+2. To get that out of the $gmt time, all I need to do is to add 2 hours (7200 seconds) to it:
Code:
$calc(7200+$gmt)

And then change it into whatever format I want:
Code:
$asctime($calc(7200+$gmt),yyyy-mm-dd HH:nn:ss zzz)

Which returns: 2016-01-23 20:53:49 +0200 GMT


EDIT: /help $asctime

Last edited by Dazuz; 23/01/16 07:05 PM.
Re: Certain Location Time Script? [Re: Dazuz] #256514 23/01/16 08:46 PM
Joined: Sep 2015
Posts: 8
N
Nordy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: Sep 2015
Posts: 8
Awesome thanks alot for your help!