Question
Velocity and Date Tokens
Hi Nation!
We are working on a velocity script to make a date formatted in a more natural language like "We will expect you on December 13". Unfortunatelly, when I try to use the line
#set( $mydate = ${convert.parseDate(${lead.mydatetoken},"YYYY-MM-dd")})
The variable $mydate is empty. I realized this has to do with the fact the string is not always YYYY-MM-dd, it can change. I still haven't figured out why, I believe it has to do with the fact that our users have different locales.
My question is... is there a way to get from the actual lead token, in this case ${lead.mydatetoken}, a definitive value regardless of locale? just as you would in other programming languages where you would get a long counting the seconds from midnight January 1st 1970?
Any help will be very appreciated, thanks!
We are working on a velocity script to make a date formatted in a more natural language like "We will expect you on December 13". Unfortunatelly, when I try to use the line
#set( $mydate = ${convert.parseDate(${lead.mydatetoken},"YYYY-MM-dd")})
The variable $mydate is empty. I realized this has to do with the fact the string is not always YYYY-MM-dd, it can change. I still haven't figured out why, I believe it has to do with the fact that our users have different locales.
My question is... is there a way to get from the actual lead token, in this case ${lead.mydatetoken}, a definitive value regardless of locale? just as you would in other programming languages where you would get a long counting the seconds from midnight January 1st 1970?
Any help will be very appreciated, thanks!