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 Quote Link to comment 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. Quote Link to comment 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] Quote Link to comment 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.