Well here is a breakdown ...
final long WIN_EPOC_MS = 11644473600000L;
final long now_ms = System.currentTimeMillis();
final long now_win_ns = (now_ms + WIN_EPOC_MS) * 10000L;
The converse should be apparent from the code above. If you want to double check conversions, use w32tm
. For example, the following shows that we have the correct conversion time in the Unix era (note that I am in CST)
w32tm / ntte 116444736000000000
134774 00: 00: 00.0000000 - 12/31/1969 06:00:00 PM (local time)
, AD , . "-1" "", "0" . , , , , ( pwdLastSet unicodePwd).
, GregorianCalendar, , ( ).