Use the NumberTool to convert it to a Number, then use the DateTool to
convert that to a Date:

#set( $myMillisAsNumber = $number.toNumber($myMillisAsString) )
#set( $myMillisAsDate = $date.toDate($myMillisAsNumber) )

or you can always extend the DateTool and add your own method to do it directly.

On 6/20/07, Jason Mansfield <[EMAIL PROTECTED]> wrote:
Hi,

I am trying to format a string that contains a date as a number of milliseconds 
since 1970 (in text format) in my velocity template.

I realise that it should be a long, but in this instance we have to deal with 
the number being represented as a string.

Is there a way of converting the string representation into a date using either 
DateTools or other Java object methods?

Many thanks

Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to