rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: olliebean on March 20, 2019, 04:43:57 PM

Title: Date format for RSS feeds
Post by: olliebean 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?
Title: Re: Date format for RSS feeds
Post by: Mars on March 20, 2019, 08:11:22 PM
http://rejetto.com/forum/index.php?topic=11546.msg1059974#msg1059974
Title: Re: Date format for RSS feeds
Post by: olliebean 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.