>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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:249919
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to