0

Ive got a script that is allows users to submit data to a db, when data is submitted a timestamp is also added, my local time zone is GMT, as is my server time as set it plesk 11, but when the data comes in its an hour behind, due to daylight savings.

Whats the best way to counteract this, i was thinking of setting my time zone -1 hour, but that seems like a bit of a dirty way to do it.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
sam
  • 173
  • 2
  • 14
  • [Administration panels are off topic](http://serverfault.com/help/on-topic). [Even the presence of an administration panel on a system,](http://meta.serverfault.com/q/6538/118258) because they [take over the systems in strange and non-standard ways, making it difficult or even impossible for actual system administrators to manage the servers normally](http://meta.serverfault.com/a/3924/118258), and tend to indicate low-quality questions from *users* with insufficient knowledge for this site. – HopelessN00b Feb 26 '15 at 08:59

3 Answers3

3

The best way (IMHO) is to write an UTC timestamp. This is always correct and can be converted into any given timezone with appropriate DST rules taken into account by your application and it's library functions.

Sven
  • 97,248
  • 13
  • 177
  • 225
0

What is wrong with using the native system time (or converting the client systems' time into the time used for the db server)? Every major OS handles timezone DST natively. (Even when the DST specs change, the relevant OSs are patched to accomodate.)

gWaldo
  • 11,887
  • 8
  • 41
  • 68
0

If you use NTP it should automatically correct your clock to DST if the timezone you selected has it enabled.

But i agree with SvW. UTC would be better if you and your clients are on different timezones.

Pedro Brito
  • 202
  • 1
  • 4