Hi
I'm pretty new to php & mysql and am looking help with a problem I have with dates. Here is some code I am using:
I have a table in the mysql database that has a list of rss feeds that updates frequently. I am trying to display on my webpage feeds added within the last 1 hour. The problem is, when I use the above code, it displays feeds added within the past 2 hours. From some brief research, it would appear (now please correct me if I am wrong) my server time is in UTC which is 1 hour behind BST which I want which is the problem.Code:$result = mysql_query(" SELECT date_format(`ItemPubDate_t`,'%H:%i %d %b %y'), ItemTitle,ItemLink,ItemSourceURL FROM feedItems WHERE `ItemPubDate_t` >= DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 60 MINUTE) ORDER BY `ItemPubDate_t` DESC LIMIT 30", $connection); if(!$result) { die("Database selection failed: " . mysql_error()); } If ($row = $result){ echo "New feeds added within last 1 hour<br/ >"; while ($row = mysql_fetch_array($result)){ echo "<tr><td>$row[0] <A href=$row[2]>$row[1]</A></td></tr>"; } }
Can anyone help me sort this problem?
Thanks
Damian





Reply With Quote