pratikpjain.15's blog

By pratikpjain.15, history, 17 months ago, In English

Hello Community,

As we can see in the image below, whenever you hover on the time section for a post or comment on codeforces, it shows you a wrong time. (I tried it for other posts and comments but same results) Not sure whether this is bug or intended, so just posting it out here.

  • Vote: I like it
  • +8
  • Vote: I do not like it

| Write comment?
»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It is working fine if you are not logged in!

»
17 months ago, # |
Rev. 7   Vote: I like it +10 Vote: I do not like it

Yes this is also a time bug as well!

Time in 'My submissions' page
Time in 'Last submissions' tab as well as 'Submission' page
  • Sorry I have a problem putting all of this images into spoiler parts
»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Its still unresolved!

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I had raised this concern 6 months ago and its still unresolved!!

  • »
    »
    11 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For me it works perfectly on all blogs I tried, including the one where the image in your original post is from. If you still have the bug, then something weird is going on.

    Picture
»
11 months ago, # |
Rev. 2   Vote: I like it +15 Vote: I do not like it

I did some testing with switching my computer's time zones, and the results are really weird:

UTC-9:30 logged in
UTC-9:30 logged out
UTC-6:00 logged in
UTC+2:00 logged in
UTC+2:00 logged out
UTC+5:30 logged in
UTC+5:45 logged in
UTC+6:30 logged in
UTC+9:00 logged in

Not only does the bug only seem to happen when logged in and timezone is UTC+??:30, the formatting on the time is really weird (14.05.2003 vs Jul/14/2023, UTC+5.5 vs UTC+5:45) and the "correct" times still very much disagree with each other:

  • Jul/14/2023 06:38 UTC-9:30 = Jul/14/2023 16:08 UTC
  • Jul/14/2023 01:08 UTC-6:00 = Jul/14/2023 07:08 UTC
  • Jul/14/2023 17:08 UTC+2:00 = Jul/14/2023 15:08 UTC
  • Jul/14/2023 18:08 UTC+2:00 = Jul/14/2023 16:08 UTC
  • Jul/15/2023 00:38 UTC+5:45 = Jul/14/2023 18:53 UTC
  • Jul/15/2023 07:08 UTC+9:00 = Jul/14/2023 22:08 UTC

MikeMirzayanov

»
11 months ago, # |
  Vote: I like it +29 Vote: I do not like it

I went through the JS files out of curiosity and i think the issue is arising because of not using strict mode while parsing moment.
Changing var m = moment(dateString, ruTime + " Z"); to var m = moment(dateString, ruTime + " Z",true); in codeforces.js?v=20160131 fixed it locally for me.
Of course i don't have the complete picture so i might be wrong but i thought i should share it anyways.Hope it helps
MikeMirzayanov