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.

closed as off-topic by HopelessN00b Feb 26 '15 at 8:59

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

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.

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.)

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.