Jump to content


Photo

MySQL now()


  • Please log in to reply
3 replies to this topic

#1 complex05

complex05
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 03 April 2006 - 05:53 PM

Is there an easy way to adjust the time for MySQL on a shared server? I could manually write into my scripts to use date(mktime()) but that would require too much work. When I enter a row, I use the now() function to timestamp the row... but since we've gone live on our shared server, we noticed that the server time is 3 hours behind ours.

Is there any easy solution?? Please give me good news :)

#2 complex05

complex05
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 03 April 2006 - 07:46 PM

bump.

#3 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 03 April 2006 - 07:53 PM

You always write dates and times with whatever the server date and time is. Then when you go to display it, you subtract or add hours as needed.

That's why this forum has a feature where it asks you what time zone you're in.



#4 complex05

complex05
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 03 April 2006 - 09:20 PM

[!--quoteo(post=361325:date=Apr 3 2006, 03:53 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ Apr 3 2006, 03:53 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You always write dates and times with whatever the server date and time is. Then when you go to display it, you subtract or add hours as needed.

That's why this forum has a feature where it asks you what time zone you're in.
[/quote]

Is there a way to change my timezone with .htaccess or something? I know I can't change the server's time...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users