Jump to content

set Now code in MySQL DB 3 hours ahead


webguync

Recommended Posts

I don't know if this can be done in PHP or needs to be done on the MySQL side, but I have some update code which sets the current time in a MySQL field. The time is 3 hours behind what I want (EST). I believe this is due too the server being in California. Anyway here is the code involved.

 

$query = "UPDATE Editor_Candidates
          SET login_timestamp = NOW()
          WHERE username = '$username'
            AND password = '$password'";

 

 

CREATE TABLE `Editor_Candidates` (
  `name` text,
  `username` text,
  `password` varchar(10) default NULL,
  `login_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `user_id` int(11) NOT NULL auto_increment,
  PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


Link to comment
https://forums.phpfreaks.com/topic/191090-set-now-code-in-mysql-db-3-hours-ahead/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.