You may want to try pushing the value through a
java.lang.Long.getLong(string nm), and seeing if that works?
ColdFusion can be funny about large numbers, because it tries ot fit
them into java.lang.Integers, which can only go so high.
Give that a shot, and let us know.
Mark
On 8/16/06, Mullai Subbiah <[EMAIL PROTECTED]> wrote:
> >I have the following code to convert timezones. session.currentTimeZone is
> >the logged-in user's timezone and session.defaultTimeZone is the machine's
> >timezone. both are java.util.TimeZone objects.
> >
> ><cfset offset =
> >session.currentTimeZone.getRawOffset()-session.defaultTimeZone.getRawOffset(
> >)>
> ><cfobject name="date" action="create" type="java" class="java.util.Date">
> ><cfset date = date.init()>
> ><cfset newtime = date.getTime() + offset>
> ><cfset date.setTime(newtime)>
> >
> >getRawOffset() returns a long and date.setTime takes a long.
> >
> >when I run this code I get 'method selection exception' saying that either
> >setTime does not have a signature with the above argument types, or that it
> >is overloaded with ambiguous types. however, java.util.Date only has one
> >signature for setTime, that takes a long. when I dump the value of offset I
> >get...
> >
> >1.05129634481E+012
> >
> >javacast() right? when i change the setTime line to
> ><cfset date.setTime(javacast("long",newtime))> i get the following error...
> >
> >"Could not convert the value 1.051296450755E12 to an integer because it
> >cannot fit inside an integer. "
> >
> >I'm confused. What does converting to an integer have to do with it? is
> >there a problem converting longs between cfmx and java?
> >
> >thanks,
> >Simon
>
>
> Hi Simon,
>
> I have similar problem. Were you able to solve it. There are not many
> articles on the web about this specific problem.
>
> Thanks in advance.
>
> Cheers,
> Mullai
--
E: [EMAIL PROTECTED]
W: www.compoundtheory.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:249924
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4