• Welcome to Jose's Read Only Forum 2023.
 

IFolder.DateLastModified Property

Started by José Roca, July 14, 2008, 01:53:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following code illustrates the use of the DateLastModified property with a folder:


#INCLUDE "windows.inc"
#INCLUDE "scrrun.inc"

DIM fso AS IFileSystem
DIM pFolder AS IFolder
DIM dDateLastModified AS DOUBLE

' Create an instance of the FileSystemObject
fso = NEWCOM "Scripting.FileSystemObject"
' Get a reference to the IFolder interface
pFolder = fso.GetFolder(UCODE$("C:\MyFolder"))
' Get the date in which the folder was last modified
dDateLastModified = pFolder.DateLastModified
' Convert the date to a formated string
DIM d  AS ASCIIZ * 64
DIM st AS SYSTEMTIME
VariantTimeToSystemTime dDateLastModified, st
GetDateFormat %LOCALE_USER_DEFAULT, %DATE_SHORTDATE, st, BYVAL %NULL, d, 64
MSGBOX "Date: " & d