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, year | WDMY |
date modifier word, month, day, year | WMDY |
date modifier word, year, month, day | WYMD |
date modifier word, year, month | WYM |
date modifier word, month, year | WMY |
date modifier word, year | WY |
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
Symbol | Description | Example |
---|---|---|
aaa | Date modifier abbreviation, lowercase | bef |
AAA | Date modifier abbreviation, uppercase | BEF |
Aaa | Date modifier abbreviation, case as keyed in String property | bef |
aaaa | Date modifier full word, lowercase | before |
AAAA | Date modifier full word, uppercase | BEFORE |
Aaaa | Date modifier full word, case as keyed in String property | before |
Days
Symbol | Description | Example |
---|---|---|
d | Day number, no leading zero, no value if day missing | 8 |
dd | Day number, leading zero, no value if day missing | 08 |
D | Day number, no leading zero, underscore if day missing | 8 _ |
DD | Day number, leading zero, underscores if day missing | 08 __ |
Month Numbers
Symbol | Description | Example |
---|---|---|
m | Month number, no leading zero, no value if month missing | 6 |
mm | Month number, leading zero, no value if month missing | 06 |
M | Month number, no leading zero, underscore if month missing | 6 _ |
MM | Month number, leading zero, underscores if month missing | 06 __ |
Month Names
Symbol | Description | Example |
---|---|---|
mmm | Month abbreviation, lowercase | jun |
MMM | Month abbreviation, uppercase | JUN |
Mmm | Month abbreviation, case as keyed in String property | Jun |
mmmm | Month, lowercase | june |
MMMM | Month, uppercase | JUNE |
Mmmm | Month, case as keyed in String property | June |
Year Numbers
Symbol | Description | Example(s) |
---|---|---|
yyy | Year number, no leading zero, no value if year missing | 870 |
yyyy | Year number, leading zero, no value if year missing | 0870 |
YYY | Year number, no leading zero, underscore if year missing | 870 ___ |
YYYY | Year number, leading zero, underscores if year missing | 0870 ____ |
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
Symbol | Description |
---|---|
\ | 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
Input | Format | Output |
---|---|---|
3 APR 832 | Aaa d Mmm yyy | 3 Apr 832 |
13 APR 832 | Aaa d Mmm yyyy | 13 Apr 0832 |
Bef 08 JUN 1970 | Aaa d Mmm yyy | b 8 Jun 1970 |
08 JUN 1970 | AAA d MMM yyy | 8 JUN 1970 |
Bef 08 JUN 1970 | AAA d MMM yyy | B 8 JUN 1970 |
Aft 08 JUN 1970 | Aaa d MMM yyy | a 8 JUN 1970 |
08 JUN 1970 | Aaa dd Mmm yyy | 08 Jun 1970 |
08 JUN 1970 | Aaa dd MMM yyy | 08 JUN 1970 |
08 JUN 1970 | Aaaa d Mmmm yyy | 8 June 1970 |
Say JUN 1970 | Aaaa d Mmmm yyy | say June 1970 |
08 JUN 1970 | Aaaa Mmmm d, yyy | June 8, 1970 |
JUN 1970 | Aaaa Mmmm d, yyy | June, 1970 |
08 JUN 1970 | AAA [(]d{)} m yyy | (8) 6 1970 |
JUN 1970 | AAA (d) m yyy | 6 1970 |
08 JUN 1970 | Aaa [\M=]Mmm [\D=]d [\Y=]yyy | M=Jun D=8 Y=1970 |
APR 832 | Aaa [\M=]MMM [\D=]d [\Y=]yyyy | M=APR D=8 Y=0832 |
Bef APR 832 | Aaa [\M=]Mmm [\D=]d [\Y=]yyy | bef M=Apr D=8 Y=832 |
This page last changed on 06 Feb 2016.