lukep11a Posted November 15, 2011 Share Posted November 15, 2011 Hi, I am trying to get the date and time that a particular table was last updated, which the code below does, but it doesn't seem to be putting it in the correct timezone, it is 5 hours behind, anyone know why this is? or how i can fix it? Thanks <?php date_default_timezone_set('Europe/London'); $query = "SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA = 'tffdb' AND TABLE_NAME = 'test_team_points'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['UPDATE_TIME']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/251212-default-timezone-set/ Share on other sites More sharing options...
phporcaffeine Posted November 15, 2011 Share Posted November 15, 2011 Well, the time that the table was last updated, should be recorded in the time / timezone that is set on the server that MySQL is running on. So what are you trying to do? Are you trying to fetch the time and then apply a UTC offset to translate the time into another timezone? Quote Link to comment https://forums.phpfreaks.com/topic/251212-default-timezone-set/#findComment-1288470 Share on other sites More sharing options...
lukep11a Posted November 15, 2011 Author Share Posted November 15, 2011 Yes I am trying to translate it into the Europe/London timezone Quote Link to comment https://forums.phpfreaks.com/topic/251212-default-timezone-set/#findComment-1288472 Share on other sites More sharing options...
phporcaffeine Posted November 15, 2011 Share Posted November 15, 2011 I think what you're looking for is gmstrftime(). http://us.php.net/manual/en/function.gmstrftime.php Quote Link to comment https://forums.phpfreaks.com/topic/251212-default-timezone-set/#findComment-1288476 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.