SOLVED

Date Format on Email Script

Go to solution
Anonymous
Not applicable

Hi,

I am using a Velocity script to add a date 14 days in the future on an email token Like so:

## Access Velocity's calendar object

#set($x = $date.calendar)

## Format date

#set($current_date = $date.format('default','short'))

## Add 24 hours (hours=int code 10 - see list below)

$x.add(6,14)

## Show result

$x.time

It is working except that the date format is just not cooperating.  I've tried a few options, but I only either get a blank or something formatted like so:

Mon Nov 30 08:09:58 CST 2015.

That's horrendous.  I'm looking for this format:

Monday, Nov. 30th, 2015.

I'm imagining some sort of string conversion needs to take place.  Also, it would probably get quite complicated with the day format (30th, 21st, 2nd, etc), so that's a wish rather than a need.

Any thoughts out there?

Cheers,

Clare

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think I see what you are doing wrong.

You are formatting $current_date

but displaying  $x

Try displaying $current_date

View solution in original post

10 REPLIES 10