OK yes I added a function to the cfc that i got from Ben Forta's site.   For
anyone that might like to venture an opinion about what on earth's going on
here, I'll paste it below.

Anyway,  your timezone.cfc or not, I still have the problem.  Does anyone
have a clue what's causing me to have the different year values?   If i use
the variable "now" in the struct returned by the function, my formatted date
shows the year '0006'.  But if i use the text cut and pasted from a dump of
the struct now,   the formatted date shows the yar '2006'.    WTF?

Here's the time function from Ben's website:


<cffunction name="GetNISTTime" returntype="struct" output="false">
   <cfset var timeServer="192.43.244.18">
   <cfset var result=StructNew()>

   *<!--- Try/catch block --->*
   <cftry>

      *<!--- Try get time data --->*
      <cfhttp url="http://#timeServer#:13/"; />
      *<!--- Save raw data --->*
      <cfset result.raw = CFHTTP.FileContent>
      *<!--- Extract Julian date --->*
      <cfset result.julian=ListGetAt(result.raw, 1, " ")>
      *<!--- Extract current date and time --->*
      <cfset result.now=ParseDateTime(ListGetAt(result.raw, 2, " ")
                              & " "
                              & ListGetAt(result.raw, 3, " "))>
      *<!--- Extract daylight savings time flag --->*
      <cfset result.dst=IIf(ListGetAt(result.raw, 4, " ") IS 0,
                        FALSE, TRUE)>
      *<!--- Extract leap month flag --->*
      <cfset result.leapmonth=IIf(ListGetAt(result.raw, 5, " ") IS 0,
                           FALSE, TRUE)>
      *<!--- Extract health flag --->*
      <cfset result.healthy=IIf(ListGetAt(result.raw, 6, " ") IS 0,
                           FALSE, TRUE)>
      *<!--- Extract advance milliseconds --->*
      <cfset result.msadv=ListGetAt(result.raw, 7, " ")>
      *<!--- Success --->*
      <cfset result.success=TRUE>

      *<!--- Catch any errors --->*
      <cfcatch type="any">
         <cfset result.success=FALSE>
      </cfcatch>

   </cftry>

   <cfreturn result>

</cffunction>


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month




On 5/25/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
>
> Mike Kear wrote:
> > Yes, Paul, it's your timezone.cfc    - piece of excellent programming to
> if
> > i might say so.
>
> no, something wrong. that thing never had any timeserver bits. it just did
> tz to
> tz conversions, get/set tz, etc.
>
> > It's invoked in the Applicatoin.cfc as follows:
> >
> > <cfscript>
> >  timezone = createObject("component","cfcs.timezone");
> >   nowuts =#timezone.GetNISTTime()#;
> > </cfscript>
> >
> > Does that help you?
>
> yes, not my tz cfc :-0
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241425
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to