Jump to content

Archived

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

almightyegg

datetime column in database

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

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.