I'm using Node.js to build my RSS file. I create a Date string with (new Date).toString()
and then use that value for the <pubDate>
field in the RSS file. However, when I run the Feed Validator, it reports that such a date string is not valid:
An example Date string that I generate is:
Fri Oct 25 2013 17:59:42 GMT+0200 (Central European Daylight Time)
If I understand correctly, in order to validate, there should be a comma after "Fri", and the "GMT" and the parens at the end should be removed. Is there an built-in way to produce such compliant strings with JavaScript or will I have to write a custom function to do this?
(new Date).toUTCString()
Documented at http://mdn.io/toUTCString
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With