You are not logged in.
Pages: 1
I know next to nothing about using Pascal scripts and am having trouble creating one that will rename a file to the previous day's date based on the system date when run. For example, changing original file name from "Gibberish.txt" to "2020-01-11.txt" I tried using "-24" in the hour span script but that didn't work. Can someone please help me with this?
Offline
You don't necessarily need the Pascal Script rule, because you can adjust date/time in the filename using the Reformat Date rule.
So you can simply insert the current system date time using the ":Date_Now:" meta tag, and then adjust it by -24 hours or whatever you need.
Offline
For the same of completeness, here is a script for inserting yesterday's date into the filename using the Pascal Script rule:
begin
FileName := FormatDateTime('yyyy-mm-dd', IncDay(Now, -1)) + WideExtractFileExt(FileName);
end.
Offline
You don't necessarily need the Pascal Script rule, because you can adjust date/time in the filename using the Reformat Date rule.
So you can simply insert the current system date time using the ":Date_Now:" meta tag, and then adjust it by -24 hours or whatever you need.
Thanks, I didn't even notice that function!
Offline
Pages: 1