Hi
I am displaying an RSS feed at my Joomla site, and I am trying to alter the timestamp for the feed items if they were posted today.
For those items posted today, I want the timestamp to simply be the hour and minute, e.g. “1:45 pm”
For those items posted on past days, I want the timestamp to be in the format of “Feb. 3”
I am using a Joomla module, which has already modified the timestamp into the format of “Feb. 3, 1:45 pm”. The php variable that displays “Feb. 3, 1:45 pm” is “$feed->itemDate”.
I was thinking it might be good to check whether “$feed->itemDate” contains today’s date, which would be formatted using the date function as “Feb. 3”. If this evaluates to true, then I could use regex to delete the comma and everything before it. If it evaluates to false, then I could delete everything after and including the comma. The problem is, I am not sure this is possible. I wanted to check before I made any futile attempts. Any help would be greatly appreciated.