Google Sheets DATEVALUE – Recognize RSS 2 pubDate (RFC822)

google sheetsgoogle-sheets-dates

My formula contains an RFC822 pubDate, e.g. as pulled from Google's RSS2 Feed.

=DATEVALUE("Thu, 01 Oct 2020 10:00:00 +0000")

but it results in

Error
DATEVALUE parameter 'Thu, 01 Oct 2020 10:00:00 +0000' cannot be parsed to date/time.
  • According to this, my locale should be set, but changing that can have other consequences in my sheet, which I do not want (FYI my current sheet locale is United States)
  • According to this stackexchange question, there is apparently no support for that

Is there a workaround to get my manually entered RFC822 dates recognized by DATEVALUE formula Google Sheets (I need this particular formula to perform various operations, so other than re-entering dates in compliant format, is there anything else I can try?

Best Answer

I did it by using a REGEXREPLACE.

Example: A1 contains Thu, 01 Oct 2020 10:00:00 +0000

In B1:

=DATEVALUE(TRIM(REGEXREPLACE(A1,"^(Sun|Mon|Tue|Wed|Thu|Fri|Sat)\,(.*)\s+\+?[0-9]{4}.*$","$2")))

B1 now shows 44104.