Jump to content


datetime stamp not in my timezone

datetime timezone mysql

  • Please log in to reply
1 reply to this topic

#1 Ron

Ron

    Member

  • Members
  • PipPip
  • 19 posts

Posted 26 March 2014 - 08:27 PM

When I post to MySQL the datetime is about 3 hrs behind. Where is my issue? I want the user to post in their timezone, too. 

 

Here is an example...

        $user_logs_update4 = array(
        "ID" => $primary_key,
        "LastUpdate" => date('Y-m-d H:i:s'));
        $this->db->update('table',$user_logs_update4,array('ID' => $primary_key));

Need some help on this one. I am a beginner in PHP. I would need detailed instructions.

 

 

 

 



#2 Ron

Ron

    Member

  • Members
  • PipPip
  • 19 posts

Posted 31 March 2014 - 02:38 PM

Again, answered my own question (not exactly, but this will work). I will use Eastern time zone only.

 

date_default_timezone_set('America/New_York');







Also tagged with one or more of these keywords: datetime, timezone, mysql

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users