A
A
Alexander2014-06-30 14:37:17
MySQL
Alexander, 2014-06-30 14:37:17

How does web server/MySQL know the timezone to write to a timestamp field?

How does Web server/MySql know the timezone to write to a timestamp field?
In http headers, the client does not send its time.
when writing to a timestamp, MySQl writes UTC 0 and when requested, pulls out UTC + GMT
GMT where does it get it from?
Question: How is the client's timezone found out?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
O
Oleg Krasnov, 2014-06-30
@OKrasnov

my.cnf

N
neol, 2014-06-30
@neol

Use system settings.

A
Andrey Burov, 2014-06-30
@BuriK666

timezone of the client can be obtained from GeoIP, or ask the client himself (in the account settings)
Well, or find out his system time using javascript and send this information to the server.

C
cloud-habr, 2014-06-30
@cloud-habr

ask and don't guess)date_default_timezone_set('Europe/Kiev');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question