Jump to content

MySQL now()


complex05

Recommended Posts

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 :)
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

[!--quoteo(post=361325:date=Apr 3 2006, 03:53 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ Apr 3 2006, 03:53 PM) [snapback]361325[/snapback][/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...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.