473,434 Members | 4,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

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
Jul 17 '05 #1
3 4402
On Fri, 27 Feb 2004 12:00:39 +0000 (UTC), "Matthew"
<no****@btinternet.com> wrote:
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?


You want: FileDateTime
Jul 17 '05 #2
On Fri, 27 Feb 2004 12:00:39 +0000 (UTC), Matthew <no****@btinternet.com>
wrote:
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


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

Jul 17 '05 #3
> You want: FileDateTime

Thanks, that's perfect.

Matthew
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jim Davis | last post by:
Before I reinvent the wheel I thought I'd ask: anybody got a code snippet that will convert the common ISO8601 date formats to a JS date? By "common" I mean at the least ones described in this...
4
by: qtip | last post by:
I have a simple table the has First Name , Last Name, SSN, Date&Time. I have a report that will show all this information but I would like to put in at calculation to tell the difference between 2...
2
by: Raed Sawalha | last post by:
I wondering if it possilble to get the directory files ordered by creation date string files = System.IO.Directory.GetFiles(strPath,"*.msg") can I sort the returned file by creation date? ...
9
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database...
3
by: richardkreidl | last post by:
I have the following module that I delete old files based on how old they are: Sub Main() Dim First_Date As String = Date.Today.AddDays(-7) Dim Archive_Files() As String =...
6
by: KoRnDragon | last post by:
I know about getlastmod() but is there one for created date? If not is there some other way of getting the created date of a file?
1
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: =?Utf-8?B?S2VsbHk=?= | last post by:
Each fall and winter I deal witht he same problem. When the daylight savings time comes into effect the time stamp for files on my external portable hard drive are 1 hour out from the time stamps...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.