Code:
Define.i DateMod
Define FilePathName$ = "c:\TRY_PB_SetFileDate.txt"
If CreateFile(0, FilePathName$)
CloseFile(0)
DateMod = ParseDate("%yy-%mm-%dd %hh:%ii:%ss", "12-01-02 00:01:01")
Debug FormatDate("%yy-%mm-%dd %hh:%ii:%ss", DateMod)
Debug SetFileDate(FilePathName$, #PB_Date_Created, DateMod)
Debug SetFileDate(FilePathName$, #PB_Date_Modified, DateMod)
Debug SetFileDate(FilePathName$, #PB_Date_Accessed, DateMod)
Debug FormatDate("%yy-%mm-%dd %hh:%ii:%ss", GetFileDate(FilePathName$, #PB_Date_Modified))
EndIf
Debug Output wrote:
12-01-02 00:01:01
1
1
1
12-01-02 00:01:01
But I get
Sunday, January 01, 2012, 11:01:01 PM for Windows 7 properties of the file.
Should I use the Windows API or am I doing something wrong with regard to daylight savings time or is this a bug?
I know DirectoryEntryDate(iDir,#PB_Date_Modified) retrieves a valid and accurate Date since I stored it and wrote it back to a file in a different location using SetFileDate() and they were identical.