Jump to content

Default timezone set


lukep11a

Recommended Posts

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'];

?>

Link to comment
https://forums.phpfreaks.com/topic/251212-default-timezone-set/
Share on other sites

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?

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.