UTC_TIMESTAMP
Posted: Thu Jul 21, 2011 7:46 pm
Hello,
I have this in my blog php code:
When someone posts a comment, it gives the time of the server in the states (+7 hours difference from my local time). What I did is to replace "NOW()" with "UTC_TIMESTAMP() + 030000". Everything worked right. BUT, if someone posts any comment after 9PM UTC time it shows the date wrong as the date is changed as well and this will show the whole time and date in a wrong format.
Is there a better solution for that? What I need is that the post is shown in the blog in the proper time and date.
I am not that good in PHP, I am using a WYSIWYG software to build up my site, and I learned some few stuff about PHP. This is the reason why I cannot figure it out!
Thanks a lot
I have this in my blog php code:
Code: Select all
if ($_POST['submit'])
{
$sql = "INSERT INTO blog_entries(category_id, dateposted, subject, body) VALUES(" . $_POST['category'] . ", NOW(), '" . fix_quotes($_POST['subject']) . "', '" . fix_quotes($_POST['body']) . "');";
mysql_query($sql);
header("Location: " . basename(__FILE__));
exit;
}Is there a better solution for that? What I need is that the post is shown in the blog in the proper time and date.
I am not that good in PHP, I am using a WYSIWYG software to build up my site, and I learned some few stuff about PHP. This is the reason why I cannot figure it out!
Thanks a lot