• Welcome to Valhalla Legends Archive.
 

How to use FILETIME (src)

Started by iago, March 04, 2004, 03:21 PM

Previous topic - Next topic

iago

Here is a little function (I calculated the number by hand, and I *think* it's right, since a google search on it gets hits):

   public static long fileTimeToMillis(long fileTime)
   {
       return (fileTime / 10000L) - 11644473600000L;
   }


From there, you can use it just like any Java time:

java.util.Date myDate = new java.util.Date(fileTimeToMillis(myFileTime));
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*