Date/time stamps from directory files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew

    Date/time stamps from directory files

    Hi

    I am trying to find a way of picking out the latest .LOG file from a
    directory. I have been looking at:

    MyName = Dir(MyPath, vbNormal) ' Retrieve the first entry.
    {loop etc.}
    If (GetAttr(MyPath & MyName) And vbNormal) = vbNormal Then

    I don't know whether this can obtain the date stamp for me, but could anyone
    point me in the right direction please?

    Thanks

    Matthew


  • J French

    #2
    Re: Date/time stamps from directory files

    On Fri, 27 Feb 2004 12:00:39 +0000 (UTC), "Matthew"
    <nospam@btinter net.com> wrote:
    [color=blue]
    >Hi
    >
    >I am trying to find a way of picking out the latest .LOG file from a
    >directory. I have been looking at:
    >
    >MyName = Dir(MyPath, vbNormal) ' Retrieve the first entry.
    > {loop etc.}
    > If (GetAttr(MyPath & MyName) And vbNormal) = vbNormal Then
    >
    >I don't know whether this can obtain the date stamp for me, but could anyone
    >point me in the right direction please?[/color]

    You want: FileDateTime

    Comment

    • River Gorge

      #3
      Re: Date/time stamps from directory files

      On Fri, 27 Feb 2004 12:00:39 +0000 (UTC), Matthew <nospam@btinter net.com>
      wrote:
      [color=blue]
      > Hi
      >
      > I am trying to find a way of picking out the latest .LOG file from a
      > directory. I have been looking at:
      >
      > MyName = Dir(MyPath, vbNormal) ' Retrieve the first entry.
      > {loop etc.}
      > If (GetAttr(MyPath & MyName) And vbNormal) = vbNormal Then
      >
      > I don't know whether this can obtain the date stamp for me, but could
      > anyone
      > point me in the right direction please?
      >
      > Thanks
      >
      > Matthew
      >[/color]

      Use the GetFileTime() API call. See attached module.

      Comment

      • Matthew

        #4
        Re: Date/time stamps from directory files

        > You want: FileDateTime

        Thanks, that's perfect.

        Matthew


        Comment

        Working...