How do you get any file's last modified date using VB6?
lastModified() method: It contains a method called lastModified() which returns the last modified date of a file or directory in form of a long millisecond epoch value, which can be made readable using format() method of SimpleDateFormat class.
File. GetCreationTime returns the creation date and time of the specified file or directory. File. GetLastAccessTime returns the date and time the specified file or directory was last accessed.
Launch BulkFileChanger, select File from the menu bar, and choose Add Files. Now, you can select the folder or file you want to use. You should see it on the list inside the app's main window. To initiate the changes, click on Actions in the menu bar and choose “Change Time/Attributes.” The keyboard shortcut is F6.
Unfortunately, this isn't possible. You can view certain and change certain file attributes in File Explorer, but you can't change the last viewed, edited, or modified dates.
There is a built in VB6 function for that - no need for FSO (although FSO is great for more advanced file operations)
From http://msdn.microsoft.com/en-us/library/aa262740%28VS.60%29.aspx
Dim MyStamp As Date
MyStamp = FileDateTime("C:\TESTFILE.txt")
Add a reference to the Microsoft Scripting Runtime (Project->References...) and use the following code:
Dim fso As New FileSystemObject
Dim fil As File
Set fil = fso.GetFile("C:\foo.txt")
Debug.Print fil.DateLastModified
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With