March 27th, 2000, 01:26 AM
I have written a guest book .php3
and store the time of each message by using
My Webhosting server has a time different
-13 hours to my location.
I just wonder is there any method which can:
1) correct the time before the data write into MySQL DB, or
2) correct the time before it displayed in
I am using following functions to write and retreive time
INSERT INTO MyGuestBook (message,time) VALUES ('$message', NOW());
$result = mysql_query_db ( ... ...);
$row = mysql_fetch_object($result);
any expert here can provide a method to me
for displaying the correct time?
ps. i am using a web hosting server,
i cannot modify the timezone in MySQL.
March 27th, 2000, 08:00 AM
You can use the mysql adddate() function to add to the timestamp when you retrieve the data:
query="select message,adddate(time,"INTERVAL 13 hour") as mod_time from MyGuestBook";
March 27th, 2000, 02:00 PM
thanks again Rod