Results 1 to 3 of 3

Thread: [RESOLVED] working with dates

Threaded View

  1. #1

    Thread Starter
    Lively Member rocket0612's Avatar
    Join Date
    Feb 2005
    Location
    Belfast, Northern Ireland
    Posts
    95

    Resolved [RESOLVED] working with dates

    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:

    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>";
    		}
    		}
    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.

    Can anyone help me sort this problem?

    Thanks
    Damian
    Last edited by rocket0612; Apr 13th, 2009 at 02:58 PM.
    The Box Said: "You need Windows Vista or better" ... So I Installed LiNUX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width