Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't find an answer for this problem.

If I have in my database data of datatypes like date and timestamp. Can the change of system date affect this saved data ? I mean, can these existing timestamp and date values be changed after the change of system date ?

Thank you very much :)

share|improve this question
up vote 1 down vote accepted

Changing the system date or the system time does not change values stored in tables.

Existing values can be changed using an UPDATE statement, though.

Datetime and timestamp columns behave differently on retrieval.

create table tz_test (
  ts timestamp not null,
  dt datetime not null

insert into tz_test values (current_timestamp, current_timestamp);

select * from tz_test;

ts                   dt
2013-06-27 09:46:14  2013-06-27 09:46:14  

Set a session timezone, and compare.

set time_zone = '-8:00';
select * from tz_test;

ts                   dt
2013-06-27 05:46:14  2013-06-27 09:46:14  

Timezone support in MySQL

Docs show you how to change both client and server timezones for testing. You have to read that.

share|improve this answer
and if I changed the timezone and then made a SELECT. Will the values inside the select transformed using that timezone or displayed as they were in database before ? – Reshi Jun 27 '13 at 13:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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