i use this to get a local file time...
Private Function GetLocalFileTime(ftIn As FILETIME) As Date
Dim st As SYSTEMTIME, ftLocal As FILETIME
Dim dtmRtn As Date
'convert from utm
Call FileTimeToLocalFileTime(ftIn, ftLocal)
'make system and return
If FileTimeToSystemTime(ftLocal, st) Then
dtmRtn = CVDate(st.wMonth & "/" & st.wDay & "/" & st.wYear & " " &
st.wHour & ":" & st.wMinute & ":" & st.wSecond)
Else
dtmRtn = 0
End If
GetLocalFileTime = dtmRtn
End Function
you can get the declares, etc. from the api viewer
Quote:
>When you get the Creation date of a file, what is reported is the date and
>time relative to GMT (Greeenwich Mean Time).
>Where I am, that's 8 hours away. For most of you in the USA, it's also
>non-zero.
>What I want to do, is to look at the (various) file dates and times, and
>report them in local time. That needs a call to GetTimeZoneInformation() -
>see below.
>SO ...
>Can anyone clarify how to use time zone information with file dates and
>times ?
>From the KnowledgeBase article Q154821 I now know how to get the extended
>file date/time info, but it's relative to GMT which is 8 hours different
>from my locale.
>What I think are the applicable function and type declarations are:
>Declare Function GetTimeZoneInformation Lib "kernel32" _
> Alias "GetTimeZoneInformation" _
> (lpTimeZoneInformation As TIME_ZONE_INFORMATION) _
> As Long
>and also ..
>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
>Hope someone can clarify this for me
>Thanks, Ian
>-----------------------------------------------------------------------
>I.L. Thomas - Consultant, Scientific Software
>PO Box 400, VICTORIA PARK, WESTERN AUSTRALIA 6979