Current location: Hot Scripts Forums » Programming Languages » PHP » time adjustment


time adjustment

Reply
  #1 (permalink)  
Old 05-09-05, 02:00 AM
dex002 dex002 is offline
Newbie Coder
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
time adjustment

Is there a way to adjust the time so that mysql timestamp displays a relative time instead of the server time?

I want my timestamps to be in Eastern Standard Time but my server stamps in Western Time (about 2hrs before). Is the a way around this so the time stamp is correct, or should I just try an add a couple of hours to the results query?

Either way, I don't know how to do it. Cheers, Dex.
__________________
i think i brained my damage
Reply With Quote
  #2 (permalink)  
Old 05-09-05, 09:54 AM
eq1987 eq1987 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
I really don't use programming talk much anymore, as i found Sitepoint - so i may not respond again.

It is possible and info about time can be found at http://us2.php.net/date

If you can't understand what they are talking about, you can reply & I might see this post again.
Reply With Quote
  #3 (permalink)  
Old 05-09-05, 12:50 PM
infinitylimit's Avatar
infinitylimit infinitylimit is offline
Code Guru
 
Join Date: Jun 2004
Location: Oregon
Posts: 758
Thanks: 0
Thanked 0 Times in 0 Posts
if you are sure it's 2 hours before just subtract off of the results query.

Timestamps are in seconds since the unix epoch 1970.

Your could we be something like this

PHP Code:

$result mysql_query('SELECT timestamp FROM table');

$relative_time mysql_result($result,0,0) - (60*60*2); 
__________________
Hawk Enterprises -- Home to PHP games, open-source code, tutorials and free downloads
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accurately showing different time zones meveskr JavaScript 5 07-20-04 03:57 PM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Reduce the time intensive phases of .Net application development using TierDeveloper3 smars General Advertisements 0 12-02-03 05:15 AM
Showing time is users time zone? Nasimov PHP 1 11-20-03 07:14 AM


All times are GMT -5. The time now is 06:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.