Wow, David, that works. Thank you.
Wonder why they chose 1/1/1601 as the starting point.
Johnny
> Remember the EPOCH times for Unix and Windows are different.
>
> Try this, read the comments I have included for you:
>
> <!---
>
> Problem: LDAP date is returned as NANOSECONDS and if you try to write
> a function to parse it CFMX returns an error saying the number is too
> big to fit in integer scope.
>
> So you have to parse it manually.
>
> --->
>
> <!--- ******** this is the date value from LDAP ********* --->
> <CFPARAM name="variables.lastLogon" default="127937470871482500" />
>
> <cfscript>
> // parse value into minutes
> variables.calcLastLogon = variables.lastlogon / (60*10000000);
>
>
> //add minutes from WINDOWS EPOCH TIME
> variables.finalResult.ts = DateAdd('n',variables.calcLastLogon,
> '1/1/1601');
>
> variables.finalResult.date = Dateformat(variables.finalResult.ts,'dddd,
> mmmm dd, yyyy');
> variables.finalResult.time = Timeformat(variables.finalResult.ts,'h:mm
> tt');
>
> //some basic output
> writeoutput('the last logon date was on ' & variables.finalResult.date
> &' at ' & variables.finalResult.time);
> </cfscript>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242355
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54