MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 27th, 2000, 12:26 AM
ccm ccm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Hong Kong
Posts: 73 ccm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 31 m 9 sec
Reputation Power: 9
I have written a guest book .php3
and store the time of each message by using
NOW().
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
the browser.

I am using following functions to write and retreive time

INSERT INTO MyGuestBook (message,time) VALUES ('$message', NOW());

and

$result = mysql_query_db ( ... ...);
$row = mysql_fetch_object($result);
echo $row->time;

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.



Reply With Quote
  #2  
Old March 27th, 2000, 07:00 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
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";

Reply With Quote
  #3  
Old March 27th, 2000, 01:00 PM
ccm ccm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Hong Kong
Posts: 73 ccm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 31 m 9 sec
Reputation Power: 9
yeah!
thanks again Rod
hehe

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > about NOW() / PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway