mIRC Home    About    Download    Register    News    Help

Print Thread
Incorrect timestamp bug? #267803 03/10/20 05:36 PM
Joined: Oct 2020
Posts: 4
E
ekcdd Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
E
Joined: Oct 2020
Posts: 4
Today (4th October 2020 DST time started at 3 am, however I noticed messages I sent to a server had a different timestamp than messages received.

I connect to an IRC server using ZNC and server-time seems to be enabled.

When I send a message the ZNC connected mIRC sees this:

-> Kangaroo.AU.AustNode.org PRIVMSG #AustNode :From ZNC
<- @time=2020-10-03T17:16:15.448Z :ekcdd_!~powroot@AustNode.org-9F41B075.vic.foxtel.net.au PRIVMSG #AustNode :From mIRC directly

The results in my ZNC connected mIRC are:

[04:16] <+ekcdd> From ZNC ** This is the correct time
[05:16] <+ekcdd_> From mIRC directly

If I change my timezone to Brisbane everything works works as it should as they don't have DST. I also checked the result of $daylight and it returns 3600. I am using a vanillia mIRC no scripts loaded besides the default aliases and remote.ini

The results for $os $version $beta $md5($mircexe,2) $file($mircexe).sig $alias(0) $script(0) $dll(0) $com(0) are: 10 7.63 9ff6317dc5ce1528da51f2f7af29c62f ok 1 1 0 0

If anymore information is required I'm happy to supply it

Re: Incorrect timestamp bug? [Re: ekcdd] #267815 06/10/20 11:14 AM
Joined: Dec 2002
Posts: 4,841
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,841
Thanks for your bug report. I have not been able to reproduce this issue so far. Just to confirm:

1) You connect to a server through ZNC.
2) Your computer says the time is "04:16" and you are in DST (+1 hour).
3) You send a private message to your own nickname.
4) The private message comes back to you ZNC prefixed with "@time=2020-10-03T17:16:15.448Z".
5) mIRC converts this to local time and reports "05:16".

I installed ZNC here locally and followed the above steps:

1) Connect to a server through ZNC.
2) Computer says time is "10:35" in DST (+1 hour).
3) Send private message to my nickname.
4) Private message comes back ZNC prefixed with "@time=2020-10-06T09:35:38.843Z"
5) mIRC converts this to local time and reports "10:35".

So in my case, mIRC is correctly adjusting the UTC time stamp to local time and adjusting for DST.

I also ran mIRC and ZNC on both Windows and a VirtualBox, connecting in both directions, changing the timezone to locations with and without DST, and the resulting time was always correct.

In which timezone is your ZNC located? Can you confirm that the PRIVMSG timestamp it is sending is the correct UTC?

Re: Incorrect timestamp bug? [Re: Khaled] #267838 07/10/20 04:43 PM
Joined: Oct 2020
Posts: 4
E
ekcdd Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
E
Joined: Oct 2020
Posts: 4
Hey Khaled,

The messages weren't private messages they were channel messages but pretty sure that wouldn't make a difference. Messages I sent from my ZNC (nickname: ekcdd) appeared correct to me and to the direct mIRC client (nickname ekcdd_), however messages sent from the direct client were wrong on the ZNC connected mIRC so yes, it's only incorrect on the ZNC connected mIRC.

My ZNC isn't hosted on my local network but is located in the same state as myself, hosted on a VPS and the Linux box reports the timezone as AEDT +1100 (same as my local machine, this was something I only checked today)

While confirming all the information you provided, I did another check, however the times now match and is displayed. This error happened right after we entered DST and mIRC was running during the transition. The timestamp 2020-10-03T17:16:15 seems to be 4:16AM (which is the correct time, so mIRC is adding DST maybe?)

Also I checked what timestamp the ZNC is currently send and it appears to be sending 2020-10-07T16:37:25.810Z and the local time is 3:39 am


I think I covered everything, if not I'm happy to cover anything I missed.

Re: Incorrect timestamp bug? [Re: ekcdd] #267839 07/10/20 06:12 PM
Joined: Dec 2002
Posts: 4,841
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,841
Thanks for looking into it.

Quote
While confirming all the information you provided, I did another check, however the times now match and is displayed. This error happened right after we entered DST and mIRC was running during the transition. The timestamp 2020-10-03T17:16:15 seems to be 4:16AM (which is the correct time, so mIRC is adding DST maybe?)

Right, if it was only happening during the transition, this may mean that the times/DST in either mIRC or ZNC, or possibly the OSs on either machine, were not synchronized.

mIRC listens for a WM_TIMECHANGE message from Windows that lets it know when the time and/or DST state has changed, so the moment the DST change occurs, mIRC updates its $daylight value. If ZNC is not listening for DST changes (which seems unlikely), or the computers on which mIRC or ZNC are running are not updating at the same time or are using different DST transition rules, this would result in this issue. There are many reports online of Windows (including 10) behaving oddly during DST transitions.

At this point, without being able to reproduce it, its hard to tell what happened in this case.

Re: Incorrect timestamp bug? [Re: Khaled] #267840 07/10/20 06:33 PM
Joined: Oct 2020
Posts: 4
E
ekcdd Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
E
Joined: Oct 2020
Posts: 4
Thing is $daylight was in fact set and it was returning 3600, as that was one of the things I checked while doing to initial report So I don't think it was a synchronization issue at least locally.

I also forgot to mention you that both connections were running in the same instance so both of them should have updated at the same time given as you said listen for WM_TIMECHANGE and this is stored globally (I assume).


If what you said is true, and I don't doubt it is, this maybe a Windows Time issue and I don't think there is much you can do about it unless the issue can be reproduced reliability.

Re: Incorrect timestamp bug? [Re: ekcdd] #267841 07/10/20 07:13 PM
Joined: Dec 2002
Posts: 4,841
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,841
Quote
I also forgot to mention you that both connections were running in the same instance so both of them should have updated at the same time given as you said listen for WM_TIMECHANGE and this is stored globally (I assume).

Okay, it looks like I did not reproduce your original setup correctly.

Can you confirm that your setup was the following:

1) Run ZNC on a server synchronized to your current time, date, and DST. Technically, this means that ZNC could run locally on the same computer as mIRC. However, if ZNC is running on a different server, and the time, date, and DST on the server are not synchronized to your local computer, that could lead to the issue described in my previous post.
2) Run mIRC on your computer.
3) In the first status window, connect directly to a server and join a channel.
4) In the second status window, connect to the ZNC that connects to the same server and joins the same channel.
5) Type a message in the first channel window - this will appear in the second channel window.
6) Type a message in the second channel window - this will appear in the first channel window
7) Compare the message times in both channels.

Does that sound right?

Also, was the ZNC running on a Windows (which version) or non-Windows server?

Re: Incorrect timestamp bug? [Re: Khaled] #267843 08/10/20 08:22 AM
Joined: Oct 2020
Posts: 4
E
ekcdd Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
E
Joined: Oct 2020
Posts: 4
Yes, that is correct, though the ZNC connected was the first server, the direct was the second though I don't think that should matter.

My ZNC (1.7.5) is running on VPS running Ubuntu 18.04, mIRC was the only thing running on Windows. Other than that it appears to be correct

Last edited by ekcdd; 08/10/20 08:26 AM.