mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 32
Daveoh Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2006
Posts: 32
$gmt returns an incorrect value when I enter DST.
I am using Windows Vista Home Premium 64-bit SP1 and mIRC 6.35.
Time zone: GMT
DST time zone: BST (GMT+1)
$gmt returns the current time (same as $ctime) instead of the time 1 hour behind.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Confirmed.
Windows XP SP3, mIRC 6.35
Time Zone: EDT (Eastern Daylight Time)
//echo -a $duration($calc($ctime - $gmt)) shows 5 hours.. the same as what I get when my time zone is EST (Eastern Standard Time)

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
But it's always been (with and without DST):
$ctime = $gmt - $timezone
or permuted:
$gmt - $ctime = $timezone

If you want to account for the DST differences, you need to use $daylight, e.g.:
"GMT" = $ctime - $daylight + $timezone
which is the same as:
$gmt - $daylight

While it's somehow confusing, I don't regard it a bug - however the helpfile coulde be more explicit here smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
the helpfile coulde be more explicit here
Definetely agreed.

Joined: Feb 2006
Posts: 32
Daveoh Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2006
Posts: 32
Hmm, I think then $gmt should automatically account for $daylight then, as either way, it's returning the wrong value and GMT isn't related to other time zones and their daylight savings.


Link Copied to Clipboard