SOLVED

Converting a date field from ISO standard

Go to solution
Travis_Schwartz
Level 4

Converting a date field from ISO standard

Hello,

 

I have a shiny new script token (thanks Sanford):

#foreach( $account in $account_cList )
#if( $account.description.equals("ARROWHEAD VISA") )
#set( $dueDate = $account.upcomingPaymentDate )
#break
#end
#end
$dueDate

The problem is it displays the date like: YYYY MM, DD 
based on the fact that the company I work for is US based, I would like to convert it to be Month (name or abbreviated), Day Year.

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Converting a date field from ISO standard

Include all the header code from 

 

https://blog.teknkl.com/velocity-days-and-weeks/

 

Then

 

 

#set( $dueDateJ = $convert.parseDate($dueDate, $ISO8601DateOnly, $defaultLocale, $defaultTimeZone) )
${date.format("MMM dd',' yyyy", $dueDateJ)}

 

 

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Converting a date field from ISO standard

Include all the header code from 

 

https://blog.teknkl.com/velocity-days-and-weeks/

 

Then

 

 

#set( $dueDateJ = $convert.parseDate($dueDate, $ISO8601DateOnly, $defaultLocale, $defaultTimeZone) )
${date.format("MMM dd',' yyyy", $dueDateJ)}