mIRC Homepage
Posted By: tomalak16 $gmt applies dst incorrectly - 17/04/06 07:18 PM
My machine is set on British Summer Time (BST) which is UCT/GMT +1. Current time is 20:15:49BST.


//echo -a $gmt(yyyy-mm-dd HH:nn:ss)
2006-04-17 19:15:49

This is correct. It gives UCT time (I'm assuming this is the point of $gmt).

//echo -a $asctime($gmt,yyyy-mm-dd HH:nn:ss)
2006-04-17 20:15:49

This is /incorrect/. I'm told $asctime applies DST settings, either local ones regardless of timezone or it asks Windows. But it should not be applied in this case.

GMT does not get daylight saved. Britain switches to BST. GMT=UCT=+0000, at all times of the year. The examples above should yield the same output.
Posted By: tomalak16 Re: $gmt applies dst incorrectly - 17/04/06 07:18 PM
Never mind.

$asctime has no idea I gave it $gmt. I didn't give it the GMT timezone, I just gave it the current date ($gmt, which is an hour in the past) but as if it were in the local timezone. Local DST then applied.

My bad... just one of those things.
© mIRC Discussion Forums