Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy not run a server side app with daylight saving time enabled?
    text
    copied!<p>I've implemented a server side application that records timestamps when records are created and updated. The app assumes that the server clock does not have daylight saving time enabled, (a) because I've read this is best practise and (b) because I imagine it would be tricky (if not impossible) to handle the ambiguities that occur, e.g. when the clocks go back by an hour in October. </p> <p>For safety, if the app detects DST is enabled on start-up, an error is logged and the app terminates. I'm being petitioned by internal stakeholders to make the application work even if the app server clock has DST enabled.</p> <p>I feel this is a foolhardy thing to try and do, but I need to convince management. Is it just that it makes implementation more tricky or is it fundamentally flawed in such a way that it's impossible for such an app (that records timestamps) to function 100% correctly at all times of the year? What is the best argument for not running such an app with DST enabled?</p> <p>The best I have come up with is:</p> <blockquote>When daylight saving time is enabled there are two time discontinuities per year. Consider the following scenario, where a server is running in the UK with clock set to local time with daylight saving enabled: <li>At 2am on Oct 25 2009 the clock goes back one hour to 1am. <li>A record is created at 1.30am <li>The app (which must store timestamps in UTC) can't tell whether this is 1.30am before or after the clock has gone back, and therefore can't determine whether to include an extra hour in the adjustment to UTC. </blockquote> <p>Is this true? Is it actually possible to determine (in a Java web-app) whether an event that occurs at 1.30am on Oct 25 is before or after the clock adjustment?</p> <p>Any better reasons for avoiding DST?</p> <p><strong>Update</strong></p> <p>Just to be clear, it's a given that the app must <em>store</em> times as UTC. The question is why, when trying to do this, it would be a bad idea to have DST enabled on the server machine.</p>
 

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