Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It doesn't make a lot of sense to save the offset. There are two possible values you can be interested in with a timestamp:</p> <ol> <li>the general <em>global timestamp</em>, e.g. "the point in time in this world at which it was 12:52am on Sept. 6 2013 UTC"</li> <li>the specific <em>local</em> time of some point in time, e.g. "17:34 on Dec. 19th 2012 in Manila, Philippines"</li> </ol> <p>Notice that both of these are actually the same thing, they express a point in time in the notation of <em>wall clock time and date at a specific location or timezone</em>. The only difference is that UTC is a specified standard "location" relative to which other timezone offsets are expressed; but there's no reason Manila in the Philippines couldn't be used for the same purpose.</p> <p>So when you want to store an absolute timestamp, you either:</p> <ol> <li>decide that all your times are stored in a specific timezone like UTC and simply store that timestamp</li> <li>decide that you are interested in a specific local time and store the timestamp <em>and its timezone</em></li> </ol> <p>Either way you need the timestamp and you need to know which timezone it's in. In 1. you decide in advance that all timestamps are in the same defined timezone and don't need to store it, in 2. you explicitly save that timezone information.</p> <p>An <em>offset</em> is not a good thing to store, because it varies throughout the year. The offset in summer may be +6 hours to UTC, but in winter may be +7. If you need to do date calculations on a localized time later on, an offset is misleading and doesn't help you much. If you know the timezone you're talking about, you can get the offset for any time of the year later on.</p> <p>MySQL doesn't support a DATETIME + TIMEZONE field (Postgres for example does), so you need to store the timezone (e.g. "Europe/Berlin") in a separate text field. If you don't need to associate a timestamp with a specific location at all, then there's no need for a timezone and you just need to store the normalized timestamp, e.g. normalized to UTC.</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    1. 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