Page 1 of 1
Uk timestamp required: mysql
Posted: Wed Jun 29, 2005 11:31 am
by raghavan20
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?
Posted: Wed Jun 29, 2005 11:47 am
by Burrito
create a date, time or datetime field on the database you must. Store the value in its native format it will. Using the php date() function or the mysql date_format function, format the date/time how you want you can.
Posted: Sat Jul 02, 2005 8:33 pm
by raghavan20
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.
Posted: Sun Jul 03, 2005 7:11 am
by Chris Corbyn
If you know the GMT offset then
Code: Select all
INSERT INTO `table` (`time_stamp`) VALUES (NOW()+(60*60*X))
Where X is the GMT offset in hours (negative or positive).