0

FILETIMEをWinApiから変換する方法(たとえば、このWINAPI関数をvb6でDateTimeに呼び出した結果から?(たとえば、DateTime.DateDiff関数への入力として使用する場合)。

4

1 に答える 1

4
Public Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type

Public Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type

Private Declare Function FileTimeToSystemTime Lib "kernel32" (lpFileTime As FILETIME, lpSystemTime As SYSTEMTIME) As Long
Private Declare Function SystemTimeToVariantTime Lib "OLEAUT32.DLL" (lpSystemTime As SYSTEMTIME, vtime As Date) As Long

Dim st As SYSTEMTIME
Dim dt As Date

' convert a FILETIME to SYSTEMTIME first
FileTimeToSystemTime ft, st

' convert the SYSTEMTIME to a Variant date (VT_DATE)
SystemTimeToVariantTime st, dt
于 2013-02-08T07:30:14.737 に答える