Repository navigation
Dates and Times: Different formats and sub-parts? #74
|
I'm a new user, so my apologies if the feature I'm suggesting is already there but I haven't found it. {current_date} in renames seems to be fixed to the format YYYY-MM-DD |
Replies: 1 comment 1 reply
|
Not with the built-in Rename action right now. The supported tokens are In the meantime you can do it with a Run script action, since Forel passes each file in file="$FOREL_FILE"; dir="${file%/*}"; name="${file##*/}"
target="$dir/$(date +%Y%m%d_%H%M%S)_$name"
[ -e "$target" ] || mv "$file" "$target"That gives Keep the script as the last action in the rule, because Forel can't track a path changed by a script. |
Not with the built-in Rename action right now. The supported tokens are
{name},{extension},{date_created},{date_modified},{current_date}and{size}, and the date format is hardcoded toyyyy-MM-ddinActionExecutor.swift. Date tokens like{year}/{month}are on the README roadmap, so it might come later.In the meantime you can do it with a Run script action, since Forel passes each file in
$FOREL_FILEand you get the fulldateformatting:That gives
20261021_134500_report.pdf. Change thedate +...part to whatever you need (%Y%m%d,%Y.%m.%d,%H%M.…