Placeholder Modifiers

format(OPTIONS)
Publishes a date field with a custom format. You can add this modifier to format supported date fields. The field will be published with the format specified in the "OPTIONS".

If you want to change the default date format used program-wide, see the program's documentation.

Example:

If $foo.date$ would ordinarily display, "2006-01-06 - 01:15 AM", we could instead have it output, "January 5th, 2006, 1:15 AM" by changing the placeholder to:
$foo.date:format(MMMM ddd, yyyy, h:mm tt)$

Important: when using format with other modifiers (see Chaining Modifiers), the format modifier MUST be the first modifier added to the placeholder. Multiple format modifiers will have no additional effect.

Valid:$bar.date:format(MM/dd/yy):html_encode$
Valid:$bar.date:format(MMM ddd, yy):uppercase:urlEncoded$
Invalid:$bar.date:html_encode:format(MM/dd/yy)$
Invalid:$bar.date:format(MMM d, yy):html_encode:format(MM/dd/yy)$

Additionally, this modifier is only valid on date placeholders as set by the program (it won't work on a regular placeholder that happens to contain a date value).

format options:

 notationdescriptionexample
Yearyy2 digit year (zero padded)06
 yyyy4 digit year2006
MonthMMMMFull month nameJanuary
 MMMShort month nameJan
 MMMonth number (zero padded)01
 MMonth number1
WeekdaywwwwFull weekday nameTuesday
 wwwShort weekday nameTue
DaydddOrnate day of month2nd
 ddDay of month (zero padded)02
 dDay of month2
24 HourHHHour of day (24h, zero padded)03
 HHour of day (24h)3
12 HourhhHour of day (12h, zero padded)04
 hHour of day (12h)4
 ttAM or PMAM
 tAM or PM (short form)A
 tttAM/PM as a numeric value (0 for AM, 1 for PM)0
MinutemmMinute of hour (zero padded)05
 mMinute of hour5
SecondssSecond of minute (zero padded)06
 sSecond of minute6
EpochepochSeconds since epoch (1970)1062201058
Program/User Defined These options (date_only, time_only, date_and_time) will format the date placeholder using the default format the user has set in the program's options. See the program documentation for more info.
 date_onlyDate only, format as defined in the programJan 1, 2004
 time_onlyTime only, format as defined in the program14:52
 date_and_timeFull date & time, format as defined in the programJan 1, 2004 - 14:52
Backslash\\Display a backslash character (otherwise it will "escape" the next character, as below).
Escape*\Don't format next character (i.e. "\Mon\t\h: MMM" would generate "Month: Feb")

*Since many common letters are used in format options, if you wish to use any of those letters as words you'll need to tell the program to ignore them by using a backslash before them.

Example:

Below are examples of common format combinations:

example format
Wednesday, January 5th, 2006 wwww, MMMM ddd, yyyy
January 5, 2006 MMMM d, yyyy
Wednesday, Jan 5, 11:00 PM wwww, MMM d, h:mm tt
1/5/2006 11:00 PM M/d/yyyy hh:mm tt
1/5/06 23:00 M/d/yy HH:mm
01/05/06 MM/dd/yy
5-Jan-06 d-MMM-yy