Format String Syntax

The custom date command requires a format string.This consists of one or more codes; the formatting codes are preceded by a percent sign (%). Characters that do not begin with % are used unchanged. The formatting codes are listed below:

%a Abbreviated weekday name
%A Full weekday name
%b Abbreviated month name
%B Full month name
%d Day of month as decimal number (01 - 31)
%m Month as decimal number (01 - 12)
%y Year without century, as decimal number (00 - 99)
%Y Year with century, as decimal number
Less frequent formatting codes:
%j Day of year as decimal number (001 - 366)
%U Week of year as decimal number, with Sunday as first day of week (00 - 53)
%w Weekday as decimal number (0 - 6; Sunday is 0)
%W Week of year as decimal number, with Monday as first day of week (00 - 53)
%% Percent sign
Time formatting codes.
Note: The only database fields have valid time values are those in the Journal table.
%H Hour in 24-hour format (00 – 23)
%I Hour in 12-hour format (01 – 12)
%M Minute as decimal number (00 – 59)
%p AM / PM time indicator (this is determined by your operating system regional settings)

The # flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows.

Format Code Meaning
%#a, %#A, %#b, %#B, %#p, %#% # flag is ignored.
%#d, %#H, %#I, %#j, %#m, %#M, %#U, %#w, %#W, %#y, %#Y Remove leading zeros (if any).


Assuming that today is 09/06/03 (UK format)

CUSTOMDATE "%B %#d, %Y"  would generate "June 9, 2003"
CUSTOMDATE "%A, %d %b, %Y" would generate "Monday, 09 Jun, 2003"
CUSTOMDATE_FIELD "Last Given" "%B %y" would generate "June 03"
CUSTOMDATE_FIELD "JournalDateEdit" "%d %b %y %#I:%M %p" would generate 09 Jun 03 4:23 PM
CUSTOMDATE_FIELD "JournalDateEdit" "%d %b %y %H:%I" would generate 09 Jun 03 16:23