Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Problems converting FILETIME date/time into MM/DD/YYYY format...

$
0
0

I did this, on cf9/linux, and it seemed to do the trick:

 

 

<cfscript>

 

Long = createObject("java","java.lang.Long");

Date = createObject("java","java.util.Date");

fileTimeToEpoch =

// take pwdLastSet From Active Directory, it's in filetime

pwdLastSet = JavaCast("long", Long.parseLong("130292682204519505"));

// take filetime and turn it into epoch/java - 1970/1/1

// http://www.silisoftware.com/tools/date.php - converted: jan 1, 1970 00:00 -00

javaTime = JavaCast("long", pwdLastSet - 116444736000000000);

// convert to milliseconds

javaTime = JavaCast("long", javaTime / 10000);

today = JavaCast("string", Date.init(javaTime));

 

 

</cfscript>

<cfdump var="#pwdLastSet#">

<cfdump var="#javatime#">

<cfdump var="#today#">


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>