Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

您如何用Java 8 Instant表示MS-DTYP`DATETIME`?

在Microsoft Spec中,DATETIME表示为2个32位整数:lowhigh

参考:https : [](https://docs.microsoft.com/en...//docs.microsoft.com/zh-
cn/openspecs/windows_protocols/ms-
dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2

FILETIME结构是一个64位值,表示自1601年1月1日(协调世界时)以来已过去的100纳秒间隔数。typedef struct _FILETIME
{DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME, PFILETIME,
LPFILETIME;
dwLowDateTime:32位无符号整数,包含文件时间的低位。dwHighDateTime:32位无符号整数,包含文件时间的高位。

例如,这是长 130280867040000000

所以高和低的计算

int high = (int)(fullval >> 32);
int low = (int)fullval; 

那么高= 30333378 和低=552794112

如何将这些计算到Java 8 Instant?

问题和答案在这里


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...