Requires IanM's Matrix1 utils (to state the obvious)
Very basic functionality based on kernel32.dll:
Get the time off a file
Convert that time to your local timezone (weird)
Convert time to something readable to humans
global kernel32 as dword : kernel32=find free dll()
load dll "C:\Windows\System32\kernel32.dll",kernel32
function GET_FILETIME(file$,which)
// which: 0-Creation 1-LastAccess 2-LastWrite
// A note on potential issues with daylight savings time: http://www.powerbasic.com/support/pbforums/showthread.php?t=42146
filetime=alloc(64*5)
fil=call dll(kernel32,"CreateFileA",file$,0x80000000,0,0,4,128)
call dll kernel32,"GetFileTime",fil,filetime,filetime+64,filetime+128
call dll kernel32,"FileTimeToLocalFileTime",filetime+which*64,filetime+192
call dll kernel32,"FileTimeToSystemTime",filetime+192,filetime+256
date=alloc(32) : time=alloc(32)
call dll kernel32,"GetDateFormatA",0,0x1,filetime+256,0,date,memory size(date)-1
call dll kernel32,"GetTimeFormatA",0,0,filetime+256,0,time,memory size(date)-1
call dll kernel32,"CloseHandle",fil
return$=peek string(date)+" "+peek string(time)
free time : free date : free filetime
endfunction return$