Two quick things:

1) those times aren't an hour off. EDT should be 4 hours off of UTC
(GMT) and you are showing it as 1 hour, so that is actually a
discrepancy of 3 hours.

2) Java uses its own date/time/timezone system that is independent of
the underlying OS. You can directly invoke the OS date bits in Java, I
believe, but it doesn't work that way by default. So if you got one
datetime from the OS (your Unix time value from the external device)
and one value from CF (which uses Java) and the two don't match up,
you might have the Java calendar settings messed up. Possibilities
include: old version of java with incorrect timezone information and
an incorrect Locale setting for Java.

Hope that helps your investigation.

Cheers,
Judah

On Wed, Apr 21, 2010 at 10:55 AM, Tom McNeer <tmcn...@gmail.com> wrote:
>
> There's a simple answer to this one; it's just beyond me.
>
> I have a routine that takes a Unix time value which is passed from an
> external device and creates a date/time object. A client complained that the
> time being generated was an hour off. He's right. But I can't figure out
> why.
>
> As a test, I ran the following code on three different servers, all running
> CF 9:
>
> -------------
>    <cfset myDate = DateAdd('s',1271779666,createDate(1970,1,1))>
>    <cfoutput >#dateFormat(myDate,'long')# -
> #timeformat(myDate,'long')#</cfoutput>
> ------------
>
> The results:
>
> Server 1 - Dev server, Eastern Time Zone
> April 20, 2010 - 4:07:46 PM GMT
>
> Server 2 - Production server, Eastern Time Zone
> April 20, 2010 - 5:07:46 PM EDT
>
> Server 3 - Production server, Central Time Zone
> April 20, 2010 - 5:07:46 PM CDT
>
> So why are the latter two servers inserting time zone information, and why
> are they advancing the time an hour?
>
> --
> Thanks,
>
> Tom
>
> Tom McNeer
> MediumCool
> http://www.mediumcool.com
> 1735 Johnson Road NE
> Atlanta, GA 30306
> 404.589.0560
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333068
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to