Jump to content

[SOLVED] Date formatting


damian0612

Recommended Posts

Hi

 

I am havng problems converting dates to the format I want.  I currently run an SQL query with the following:

 

SELECT CONVERT_TZ(ItemPubDate_t, '+00:00', '+1:00'),ItemTitle,ItemLink,ItemSourceURL 
FROM feedItems 
WHERE DATEDIFF(NOW(), `ItemPubDate_t`) = 0  
ORDER BY `ItemPubDate_t` DESC

 

I then display the results as follows:

 

	echo "<tr><td>$row[0] <A href=$row[3]>$row[1]</A> $linksource</td></tr>";} 

 

The field ItemPubDate_t is a datetime field and currently returns the date as '2009-04-20 10:23:20'.  I want to convert the ItemPubDate_t to display the time only.  I can't do this in the query using:

 

SELECT date_format(`ItemPubDate_t`,'%H:%i')

 

as I am already querying it and adding one hour to times.  I would like to know how I can do this using php?

 

Mant thanks

Damian

Link to comment
https://forums.phpfreaks.com/topic/154834-solved-date-formatting/
Share on other sites

Archived

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

×
×
  • Create New...

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.