removing time stamp from a date field | Adobe Higher Education
Skip to main content
August 24, 2016
질문

removing time stamp from a date field

  • August 24, 2016
  • 2 답변들
  • 1706 조회

Hi All,

I'm trying to use a trial end date token in a email, but the date is formatted as MM-DD-YY 00:00:00. Is there a way I can remove the time stamp? we are syncing this data over from our application database so it would not be easy to change it at the source.

이 주제는 답변이 닫혔습니다.

2 답변

August 24, 2016

Hi Joshua,

This would be a great candidate for using velocity script in an email script token. I haven't come across this use case myself in the past, but there is some great documentation out there on converting date formats. Here's one in relation to localized date formatting from Jenna Molby​: How to Localize a Date Field in Marketo

It's not your exact use case, but it's a good start.

Hope that helps,

Tim

SanfordWhiteman
Level 10
August 24, 2016

Velocity script:

#set( $myRealDate = $convert.parseDate($lead.myDateyStringField.,'MM-dd-yy HH:mm:ss') )

${date.format('MM-dd-yy',myRealDate)}

August 25, 2016

Hi Sanford,

quick follow up question. Do I put this into the program token list and then use this as the token or still use the original date token?

FYI I'm using the email script token to create this.

SanfordWhiteman
Level 10
August 25, 2016

Add this as a new {{my.token}} and use the new token name in the email.