File Dates 
Author Message
 File Dates

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



Tue, 07 Mar 2000 03:00:00 GMT  
 File Dates

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



Tue, 07 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. File Info???File Date???

2. Problems resetting file archive and file date.

3. Get file date from file

4. Updating file-date

5. Return File Date Time stamp

6. Get File Date

7. file date at report

8. ACC97: Retrieving file date and time

9. Read file Date/Time last modified

10. finding a file date

11. Get file date and time

12. File Date Time Properties Wrong

 

 
Powered by phpBB® Forum Software