G
Guest
Hi,
it should be simple,
put FILETIME in a Long
conver it in date using the DateTime.FromFileTimeUtc
The help even says: Converts the specified Windows file time to an
equivalent UTC time.
Now why happens this:
original filetime 21/02/2006 00:33:29
bytes:
80 C2 E6 AB
6D 36 C6 01
when I convert it I have:
1) 20/02/2006 22:26:19
2) 20/02/2006 22:26:19
Code:
Dim ad3 As System.DateTime
Dim aLn1 As Long
Dim ad1 As System.Runtime.InteropServices.ComTypes.FILETIME
ad1.dwHighDateTime = &H1C6366D
ad1.dwLowDateTime = &HABE6C280
aLn1 = (CLng(ad1.dwHighDateTime) << 32) + CLng(ad1.dwLowDateTime)
ad3 = DateTime.FromFileTimeUtc(aLn1)
Debug.Print("1) " & ad3)
ad3.ToLocalTime()
Debug.Print("2) " & ad3)
and even worst if I do:
ad3 = CDate("21/02/2006 00:33:29")
the Thicks property is equal to:
ad3.Ticks &H8C8049591E69280 Long
please can anyone help me?
Thanks,
M.
it should be simple,
put FILETIME in a Long
conver it in date using the DateTime.FromFileTimeUtc
The help even says: Converts the specified Windows file time to an
equivalent UTC time.
Now why happens this:
original filetime 21/02/2006 00:33:29
bytes:
80 C2 E6 AB
6D 36 C6 01
when I convert it I have:
1) 20/02/2006 22:26:19
2) 20/02/2006 22:26:19
Code:
Dim ad3 As System.DateTime
Dim aLn1 As Long
Dim ad1 As System.Runtime.InteropServices.ComTypes.FILETIME
ad1.dwHighDateTime = &H1C6366D
ad1.dwLowDateTime = &HABE6C280
aLn1 = (CLng(ad1.dwHighDateTime) << 32) + CLng(ad1.dwLowDateTime)
ad3 = DateTime.FromFileTimeUtc(aLn1)
Debug.Print("1) " & ad3)
ad3.ToLocalTime()
Debug.Print("2) " & ad3)
and even worst if I do:
ad3 = CDate("21/02/2006 00:33:29")
the Thicks property is equal to:
ad3.Ticks &H8C8049591E69280 Long
please can anyone help me?
Thanks,
M.