Introduction

This page explains the symbols used in custom date formats and other rules that affect the use of custom date formats. Date formats are set via the Dates section.

Second Site includes multiple properties that are lists of date formats. The user can select one of the available formats. The formats use a particular syntax to express formatting rules for the parts of a date. The date formats look similar to custom date formats in other programs such as Microsoft Excel. The date formatter supports a few dozen symbols such as "d", "mmm", "yyyy", etc., to express how the user wants to format a date subfield. The sequence of the symbols and delimeters determines the sequence of those elements in the output date.

In order to keep the user interface simple, Second Site presents a list of date formats. Some users may desire date formats that are not in the list. Those users can add their choices to the list by editing the 2ndsite.ini file.

Symbol Sequence

Second Site does not support all the possible sequences of the available symbols. Every format must begin with one of the "date modifier word" symbols "Aaa", "aaa", "AAA", "Aaaa", "aaaa", or "AAAA". The supported sequences are as follows:

Sequence Abbreviation
date modifier word, day, month, yearWDMY
date modifier word, month, day, yearWMDY
date modifier word, year, month, dayWYMD
date modifier word, year, monthWYM
date modifier word, month, yearWMY
date modifier word, yearWY

Literal Characters

Custom date formats support literal characters mixed with the date part symbols. This capability is typically used to provide punctuation characters such as spaces, commas, slashes, dashes, and parentheses.

TMG and Second Site include support for partial dates, i.e. dates that include a month and year only, or a year only, rather than a day, month, and year. When a date part is missing, Second Site has to guess whether or not to include the literal characters that precede or follow the date part symbol for which there is no value. If the default processing does not produce the desired results, try using the [] and {} symbols to make explicit prefixes and suffixes.

Date Part Symbols

Here are the available symbols and what they mean.

Date Modifier Words

SymbolDescriptionExample
aaaDate modifier abbreviation, lowercasebef
AAADate modifier abbreviation, uppercaseBEF
AaaDate modifier abbreviation, case as keyed in String propertybef
aaaaDate modifier full word, lowercasebefore
AAAADate modifier full word, uppercaseBEFORE
AaaaDate modifier full word, case as keyed in String propertybefore

Days

SymbolDescriptionExample
dDay number, no leading zero, no value if day missing8
ddDay number, leading zero, no value if day missing08
DDay number, no leading zero, underscore if day missing8
_
DDDay number, leading zero, underscores if day missing08
__

Month Numbers

SymbolDescriptionExample
mMonth number, no leading zero, no value if month missing6
mmMonth number, leading zero, no value if month missing06
MMonth number, no leading zero, underscore if month missing6
_
MMMonth number, leading zero, underscores if month missing06
__

Month Names

SymbolDescriptionExample
mmmMonth abbreviation, lowercasejun
MMMMonth abbreviation, uppercaseJUN
MmmMonth abbreviation, case as keyed in String propertyJun
mmmmMonth, lowercasejune
MMMMMonth, uppercaseJUNE
MmmmMonth, case as keyed in String propertyJune

Year Numbers

SymbolDescriptionExample(s)
yyyYear number, no leading zero, no value if year missing870
yyyyYear number, leading zero, no value if year missing0870
YYYYear number, no leading zero, underscore if year missing870
___
YYYYYear number, leading zero, underscores if year missing0870
____

The mixed-case symbols Aaa, Aaaa, Mmm, and Mmmm don't necessarily return mixed case results. The symbol returns the value of the associated String property. The value may or may not start with a capital letter. By default, the English versions of the date modifier word strings (see the Date Strings 2 section) are lowercase, e.g., "before". The English versions of the month names (see the Date Strings 3 section) are mixed case, e.g., "January".

Special Characters

SymbolDescription
\Use a backslash before a character to defeat the special meaning of the character. For example, to include a literal "m" in the output, you must key "\m" or the letter will be interpreted as part of a symbol reference. Use "\\" to include a backslash as a literal character.
[ and ]Text between the [ and ] symbols is treated as a prefix for the next symbol. If the symbol has a value, the prefix will precede to the value in the output.
{ and }Text between the { and } symbols is treated as a suffix for the prior symbol. If the symbol has a value, the suffix will follow the value in the output.

Examples

InputFormatOutput
3 APR 832Aaa d Mmm yyy3 Apr 832
13 APR 832Aaa d Mmm yyyy13 Apr 0832
Bef 08 JUN 1970Aaa d Mmm yyyb 8 Jun 1970
08 JUN 1970AAA d MMM yyy8 JUN 1970
Bef 08 JUN 1970AAA d MMM yyyB 8 JUN 1970
Aft 08 JUN 1970Aaa d MMM yyya 8 JUN 1970
08 JUN 1970Aaa dd Mmm yyy08 Jun 1970
08 JUN 1970Aaa dd MMM yyy08 JUN 1970
08 JUN 1970Aaaa d Mmmm yyy8 June 1970
Say JUN 1970Aaaa d Mmmm yyysay June 1970
08 JUN 1970Aaaa Mmmm d, yyyJune 8, 1970
JUN 1970Aaaa Mmmm d, yyyJune, 1970
08 JUN 1970AAA [(]d{)} m yyy(8) 6 1970
JUN 1970AAA (d) m yyy6 1970
08 JUN 1970Aaa [\M=]Mmm [\D=]d [\Y=]yyyM=Jun D=8 Y=1970
APR 832Aaa [\M=]MMM [\D=]d [\Y=]yyyyM=APR D=8 Y=0832
Bef APR 832Aaa [\M=]Mmm [\D=]d [\Y=]yyybef M=Apr D=8 Y=832
On This Page