Hej Det här är lite kod som kanske kan vara till din hjälp, jag har tagit det ur ett av mina tidigare projekt så du får städa undan sånt du inte behöver..Sv: TimeStamp?
Testa det här
Private Sub Command1_Click()
MsgBox FileDateTime("C:\NetLog.txt")
End Sub
/SvenSv: TimeStamp?
"The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC)."
"The UTC method returns the number of milliseconds between midnight, January 1, 1970 UTC and the supplied date"
<code>
Option Explicit
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
Public Type TIME_ZONE_INFORMATION
Bias As Long
StandardName(32) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(32) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
Public Type TIMES
SYSTEM As String
LOCAL As String
End Type
Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Function SystemTimeToTzSpecificLocalTime Lib "kernel32" (lpTimeZoneInformation As TIME_ZONE_INFORMATION, lpUniversalTime As SYSTEMTIME, lpLocalTime As SYSTEMTIME) As Long
Public Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long
Public Function GetTimes() As TIMES
Dim udtSysTime As SYSTEMTIME
Dim udtLocTime As SYSTEMTIME
Dim udtLocTimeSpec As TIME_ZONE_INFORMATION
Call GetSystemTime(udtSysTime)
Call GetTimeZoneInformation(udtLocTimeSpec)
Call SystemTimeToTzSpecificLocalTime(udtLocTimeSpec, udtSysTime, udtLocTime)
GetTimes.LOCAL = TimeToString(udtLocTime)
GetTimes.SYSTEM = TimeToString(udtSysTime)
End Function
Private Function TimeToString(lpTime As SYSTEMTIME) As String
With lpTime
TimeToString = CStr(Format(.wYear, "0000-")) & _
CStr(Format(.wMonth, "00-")) & _
CStr(Format(.wDay, "00 ")) & _
CStr(Format(.wHour, "00:")) & _
CStr(Format(.wMinute, "00:")) & _
CStr(Format(.wSecond, "00.")) & _
CStr(Format(.wMilliseconds, "000"))
End With
End Function
</code>
Hoppas du har nytta av det.
Janne