velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: [Vel-Tools] Converting a long return type into a formatted Date
Date Thu, 06 Jan 2005 19:59:02 GMT
in VTL, long and Long are the same.  have you tried just using
DateTool.toDate(Long) with the long?

On Thu, 06 Jan 2005 14:50:34 -0500, Mike Kienenberger
<mkienenb@alaska.net> wrote:
> I'm trying to figure out how to convert File.lastModified (type long) into a
> formatted date in Velocity.
> 
> It appears that I need to use DateTool.toDate(Long obj) to go from a long
> value to a Date.
> 
> However, neither NumberTool nor MathTool provides a method to convert a long
> to a Long.   I can convert it to an Integer with MathTool.toInteger().  Or
> MathTool.toNumber() and -- if the number is large enough -- it'll force it
> to be a Long, but it's not guaranteed.
> 
> Perhaps DateTool should be modified to handle toDate(Number obj).   Or
> MathTool modified to provide toLong(), toFloat(), etc.   Or both.
> 
> Hopefully, I'm overlooking something obvious, which is why I posted to user
> and not dev.
> 
> Thanks,
> 
> -Mike
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message