怎样把8个字节的16进制转化为时间?
如
E6 A1 A9 3E 12 3F E3 40 对应时间为 2007-11-30 13:41:00
[解决办法]
Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Dim sinStr As String
Dim sinSj As Double
Dim bytes(7) As Byte
Dim i As Integer
Private Sub Command1_Click()
sinStr = "E6 A1 A9 3E 12 3F E3 40"
Text1 = sinStr
For i = 1 To Len(Text1) Step 3
bytes((i - 1) / 3) = Val("&H" & Mid(sinStr, i, 2))
Next
CopyMemory ByVal VarPtr(sinSj), ByVal VarPtr(bytes(0)), 8
Dim strDate As Date
strDate = CDate(sinSj)
Text2 = strDate
Print strDate
End Sub