almightyegg Posted October 23, 2006 Share Posted October 23, 2006 im in uk, so therefore i want it to show GMT time but it shows 6 hours behind...how can i change it to gmt?*note* it is for an updates section, when an admin posts an update it shows time aswell Link to comment https://forums.phpfreaks.com/topic/24833-datetime-column-in-database/ Share on other sites More sharing options...
Orio Posted October 23, 2006 Share Posted October 23, 2006 You can use [url=http://www.php.net/manual/en/function.date-default-timezone-set.php]date_default_timezone_set()[/url] for that. Notice you need PHP5.Orio. Link to comment https://forums.phpfreaks.com/topic/24833-datetime-column-in-database/#findComment-113093 Share on other sites More sharing options...
almightyegg Posted October 23, 2006 Author Share Posted October 23, 2006 how would i use that??[code]$title= $_POST['title'];$uptext= $_POST['uptext'];$time = date("Y-m-d H:i:s"); if((!$title) || (!$uptext)){ echo 'You did not submit the following required information! <br />'; if(!$title){ echo "A title is required field. Please enter it below.<br />"; } if(!$uptext){ echo "Update text is required field. Please enter it below.<br />"; } echo "SOMETHING IS WRONG!!!"; exit();} $sql = mysql_query("INSERT INTO updates (title, uptext, time) VALUES('$title', '$uptext', '$time')") or die (mysql_error()); [/code] Link to comment https://forums.phpfreaks.com/topic/24833-datetime-column-in-database/#findComment-113106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.