Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>Hazarding a guess here so I might be quite wrong.</em></p> <p>The problem is that the test timesatmp you've specified has an offset of <code>0</code> so it's the same as UTC - but <strong><em>that's not the same as your time when following DST in the GMT timezone</em></strong>.</p> <p>GMT is the same as UTC i.e. the offset is <code>0</code>. However, you mention DST and when following Daylight Savings Time, your clock moves forward by 1 hour and so does your UTC offset. So your time right now, with respect to UTC, is actually <code>UTC + 0100</code>. That's where the extra hour is coming from.</p> <p>It might help to convert all times to UTC first, after all, that's what it's for, right? <code>02:30 GMT</code> while following DST is <code>01:30 UTC</code>. So compared to this, the test timestamp of <code>02:01 UTC</code>, is about a half hour in the future - hence the <code>32 minutes from now</code>.</p> <p>If you were expecting to see <code>30 minutes ago</code> instead, your test date should have been <code>2011-05-31T01:01:44+00:00</code> in order to express a UTC timestamp that was equivalent to the time of <code>02:01</code> <em>by your clock display</em>.</p> <hr> <p>The safest solution would be to use UTC timestamps always - this is how SO, Facebook and Twitter date their posts. The UTC timestamp can then be unambiguously interpreted and formatted for each user's timezone.</p> <p>Your job, then, would be to make sure the timestamp you use is not simply what you see on your clock face, but the UTC equivalent of it - in your current timezone, the UTC time could be 1 hour behind the time displayed. And depending on what you're using to generate your HTML, you should be able to find a function, built-into the language/platform or as a third-party library, that will give you the UTC equivalent of the current time displayed on your clocks in your timezone considering DST.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload