Jump to content

Recommended Posts

Hi,

I am testing out a form and have a timestamp field set up in MySQL. In my PHP script I have this:

date_default_timezone_set('America/New_York');

 

the time that displayed in the database is 2010-02-25 13:32:31, which I believe is 3:32? Anyway, I submitted the form at 4:32 EST, so it seems to be off an hour for some reason. Anyone know why?

 

 

Link to comment
https://forums.phpfreaks.com/topic/193404-submit-timestamp-not-as-expected/
Share on other sites

actually I have a timestamp field in MySQL set up like this.

submit_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP

 

and then when the SQL INSERT is executed the timestamp is set. Yes, I believe the server is on the West coast. Thanks!

The mysql server is compltely separate from the web server/php.

 

You would need to set the mysql time zone. Unless you have administrative access to the mysql server, you would need to use a per-connection setting - http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html

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.