Author Topic: Date format for RSS feeds  (Read 275 times)

0 Members and 1 Guest are viewing this topic.

Offline olliebean

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Date format for RSS feeds
« on: March 20, 2019, 04:43:57 PM »
I have hfs.filelist.tpl set up to generate an RSS feed to access a folder of radio recordings as a podcast, which is working well apart from one problem. I have the pubDate set to %item-modified%, so that the item's date will be the date the file was recorded, but this isn't working and my podcatcher is displaying all items with a date of 01/01/1970.

A bit of online research has turned up that the format of the pubDate field ought to conform to RFC 822, as follows: "Wed, 20 Mar 2019 16:30:00 GMT" - but the %item-modified% symbol returns the date according to the OS Short date settings, and Windows does not have an option for the required format.

With a bit of experimentation, I've found that using the Long date, set to show as "20 Mar 2019", works - is there any way to use the Long date format, instead of the Short date format, for %item-modified%, or to otherwise customise the date format?

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1880
    • View Profile

Offline olliebean

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: Date format for RSS feeds
« Reply #2 on: March 20, 2019, 09:31:50 PM »
Thanks, that's perfect! So just to confirm, the following code in the template specifies pubDate equal to %item-modified% with the full correct RFC 822 time/date format (assuming GMT time zone):

Code: [Select]
<pubDate>{.time|format=ddd, dd mmm yyyy hh:nn:ss|when=%item-modified-dt%.} GMT</pubDate>
This is now being correctly parsed by my podcatcher.