0

I am using content syndication to parse through an RSS feed to display content in an email newsletter. Part of the logic in the template will require to only show content if it's less than 7 days old. However the date on the RSS feed is in the following format:

Thu, 30 Oct 2014 11:00:06 +0000

Is there a way to convert this to a date format that AMPscript can read?

1

As previously mentioned, both the DateParse() and StringToDate() functions will work.

%%[

var @dateStr
set @dateStr = "Thu, 30 Oct 2014 11:00:06 +0000"

]%%

<br>dateStr : %%=v(@dateStr)=%%
<br>DateParse: %%=DateParse(@dateStr)=%%
<br>StringToDate: %%=StringToDate(@dateStr)=%%

Output

dateStr : Thu, 30 Oct 2014 11:00:06 +0000 
DateParse: 10/30/2014 5:00:06 AM 
StringToDate: 10/30/2014 5:00:06 AM 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.