Uk timestamp required: mysql
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
Uk timestamp required: mysql
I have got a table where I want to store the timestamp created by mysql not php. The time stamp it gives is not UK time, is it possible to get UK time?
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
I have seen this date_format() which is used in 'select' statement to format the date received from the db.
But I want to the db to store UK timings instead of US timings because my host is in US. Is it possible to store UK timings in the db using any default value in the timestamp field? If not possible to set in mysql, tell me a function by which I can get GMT timing.
But I want to the db to store UK timings instead of US timings because my host is in US. Is it possible to store UK timings in the db using any default value in the timestamp field? If not possible to set in mysql, tell me a function by which I can get GMT timing.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
If you know the GMT offset then
Where X is the GMT offset in hours (negative or positive).
Code: Select all
INSERT INTO `table` (`time_stamp`) VALUES (NOW()+(60*60*X))