I was prepared to use the Scripting.FileSystemObject to retrieve the DateLastModified (see code sample in thread184-212462, the code sample there can be used when the user needs DateCreated or DateLastAccessed) when I discovered FDATE({filename},1) which is so very simple to use to obtain the file's last modified DateTime. Neat, very neat!
However, I noticed a small discrepancy between the two groups. For most users it probably doesn't matter, especially if you never mix the two groups' data together for comparisons. But the Windows OS (Windows Explorer, right click on file to see Properties) and the FileSystemObject both report DateLastModified identically while VFP's ADIR() and FDATE({filename},1) both report a DateTime that is always 1 or 2 seconds later.
Is there a reason for this? My guess is VFP (as tested with XP and VFP 9.0 SP1/SP2) could be calculating or rounding the DateTime in a different manner than does the OS and FSO. Anyone know why? It's only a couple 1 or 2 seconds off, but would this warrant a HotFix?
Microsoft supplies VFP code to build the DateTime by calling Kernel32:
I reported an error in line 131 of their code sample. The value sent into the GetFileTime() function is CreationTime when it should instead be by reference as [blue]@[/blue]CreationTime
However, I noticed a small discrepancy between the two groups. For most users it probably doesn't matter, especially if you never mix the two groups' data together for comparisons. But the Windows OS (Windows Explorer, right click on file to see Properties) and the FileSystemObject both report DateLastModified identically while VFP's ADIR() and FDATE({filename},1) both report a DateTime that is always 1 or 2 seconds later.
Is there a reason for this? My guess is VFP (as tested with XP and VFP 9.0 SP1/SP2) could be calculating or rounding the DateTime in a different manner than does the OS and FSO. Anyone know why? It's only a couple 1 or 2 seconds off, but would this warrant a HotFix?
Microsoft supplies VFP code to build the DateTime by calling Kernel32:
I reported an error in line 131 of their code sample. The value sent into the GetFileTime() function is CreationTime when it should instead be by reference as [blue]@[/blue]CreationTime