Jump to content

date and time that are auto inserted into my database are wrong


sandrine

Recommended Posts

when i insert some info into my mysql using a form on my website the date and time that are auto inserted into my database are wrong. the date is minus one day and the time is also many hours behind.

iam using a form to get the info and a simlpe php script does the inserting into my database.

can any one point me in the right direction thanks.

Link to comment
Share on other sites

NTP is short for Network Time Protocol. It's a protocol for synchronizing clocks. You can only set that up if you are the administrator of the server. I don't know if your server's clock is off though. You can check that yourself by echoing the date and time to see if it's correct or not.

Link to comment
Share on other sites

ok i figured it out you can change the time zone quite eqsily but i cant as iam on a free hosting so cant access .htaccess fully or php.ini at all. the server is in the usa and iam in the uk so i need to either upgrade and get paid hosting or find a free host based in the uk thanks for the help tho.

Link to comment
Share on other sites

Postgre's timestamp fields support with timezone or without timezone.  If the database you are using does the same, then you can just insert it with the correct timezone and display it with the user's timezone.  Then it will all be correct!

Link to comment
Share on other sites

  • 2 months later...
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.