Publication of this update was delayed due to amount of editing required.
BETA versions are now only available for registered users.
Find the download link at the bottom of the License Lounge.
- + Scripting got a new function.
Name: formatdate
Action: Returns a date/time expression in a specific format,
optionally shifted by a specific interval.
Syntax: formatdate([date], [format], [shift_unit], [shift_num])
date: [optional] Date expression to be formatted.
Defaults to now.
format: [optional] e.g. yyyymmdd_hhnnss;
also supports named formats Zodiac and ISOWeek
Defaults to general system date/time format.
shift_unit: [optional] unit to shift date by
y = years
m = months
w = weeks
d = days
h = hours
n = minutes
s = seconds
Legal results: between 01.01.0100 and 31.12.9999
else error
shift_num: [optional] number of units to shift date by
negative to go back in time
must be an integer value
Examples:
::text formatdate(); //16.08.2009 08:27:05
::text formatdate(, "yyyymmdd_hhnnss"); //20090816_082217
::text formatdate("", "yyyymmdd_hhnnss"); //Error: Invalid date
::text formatdate("16.08.2009", "Zodiac"); //Leo
Examples for shifted dates:
// returns 16.08.2009 08:00:03
::text formatdate("16.08.2009 08:00:00", , "s", 3);
// returns 16.08.2009 08:03:00 (+ 3 minutes)
::text formatdate("16.08.2009 08:00:00", , "s", 180);
// returns 16.08.2009 07:59:59
::text formatdate("16.08.2009 08:00:00", , "s", -1);
// returns 16.08.2009 11:30:00 (+ 3.5 hours)
::text formatdate("16.08.2009 08:00:00", , "n", 210);
// returns 16.08.2009 08:00:00 with error "Date shifting failed"
::text formatdate("16.08.2009 08:00:00", , "y", 7991);
Usage:
A practical example would be to shift the timestamp of your
photos after coming back from a holiday in a different zime
zone:
//set modified date of current file to its EXIF + 6 hours
::timestamp m, formatdate("", ,"h", 6); - ! Raw View Hex mode: Would not display Unicode files correctly on Unicode/MBCS systems like Chinese, Japanese. Fix #4.