Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
So I ran into this little issue ... (thanks to user Granny646) Since Windows 8, it seems that Windows doesn't like file dates prior to 1980. This seems a mixed bag of certain functions (for example FileSetDate) not properly supporting dates like that and the Windows File Explorer not displaying it either.
Again: Windows File Explorer will not show a date when file date is set to a date to prior 1980.
Example:
However: this is not a filesystem limitation (tested with NTFS, not and issue under macOS and Linux either).
So how do we set the file date with a date like that in Lazarus Pascal? I found a little function for that (minor modification from this one by howardpc):
uses ... FileUtil, Windows ...
...
function SetFileDate(const aFilename: string; aDate: TDateTime): boolean;
var
fileHandle : THandle;
fileTime : TFILETIME;
LFileTime : TFILETIME;
LSysTime : TSystemTime;
begin
Result:=False;
if not(DirectoryExists(aFilename) or FileExists(aFilename)) then exit;
try
DecodeDate(aDate, LSysTime.Year, LSysTime.Month, LSysTime.Day);
DecodeTime(aDate, LSysTime.Hour, LSysTime.Minute, LSysTime.Second, LSysTime.Millisecond);
if SystemTimeToFileTime(LSysTime, LFileTime) then
begin
if LocalFileTimeToFileTime(LFileTime, fileTime) then
begin
fileHandle:=FileOpenUTF8(aFilename, fmOpenReadWrite or fmShareExclusive);
if SetFileTime(fileHandle, fileTime, fileTime, fileTime) then
Result:=True;
end;
end;
finally
FileClose(fileHandle);
end;
end;
XSlimmer Awesome tool to get back some of the wasted harddisk space by removing unused application stuff. Highly recommended!
MySolutions.Tech Best DVD/Blu-ray/Video Solutions-Help You to Digitize Your Colorful Life
Links Page These and more of our favorite links can be found on the Links Page.
New Downloads
ConnectMeNow4-v4.0.18-macOS-x86-64.dmgDate: 2024-04-24 - Size: 3.5 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Intel version which works on Intel and Apple Silicon Macs.
ConnectMeNow4-v4.0.18-macOS-arm64.dmgDate: 2024-04-24 - Size: 3 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Apple Silicon version (not suitable for Intel).
MiniWOL2 MacOS (64 bits Apple Silicon)Date: 2023-08-01 - Size: 1.2 MBminiWol is a simple, but effective application to send Wake On LAN to network devices. This is the signed 64 bit MacOS ARM (Apple Silicon) version.
MovieScanner2-2.2.3-Windows-32bit-setup.exeDate: 2023-04-12 - Size: 18.6 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 32 bit Windows version.
MovieScanner2-2.2.2-Linux-GTK-64bits.tar.gzDate: 2023-04-11 - Size: 29.2 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for GTK.
MovieScanner2-2.2.2-Linux-QT5-64bits.tar.gzDate: 2023-04-11 - Size: 29.1 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for QT5.
Downloads Page Find these and more Downloads on the Downloads Page, where you will also find articles references, operating system requirements and categories.
Amazon Ads
Support us by doing your shopping at Amazon.com, either click the link, or click one of the links below …
You can also sponsor us through these Amazon offerings:
Please consider disabling your ad blocker for our website.We rely on these ads to be able to run our website.You can of course support us in other ways (see Support Us on the left).