Date format strings are used by the Vermont Views system to allow flexibility in entering dates in a variety of formats. By using a date format string, you can use dates in any number of formats, including U.S. style (month/day/year), European style (day/month/year), just the month and year.
A date format string is composed of the following control characters:
| D | Represents a numeric day. There can only be 2 Ds in a date format string. |
| M | Represents a numeric month. There can only be 2 Ms in a date format string. |
| S | Represents a string month (for example, Mar or March depending on the number of Ss). |
| Y | Represents a numeric year. There can be 2 or 4 Ys in a date format string. If you want to use years greater than 2000, you should specify 4 Ys in your date format string. |
Any character other than M, D, Y, and S can be used as date separators between the day, month, and year components of the date.
String months are determined by accessing an array of month names. This array is located in vv_main.h. If the date format string specifies three Ss only the first three letters in the month name are used. For international compatibility, you can change the month names in this array to the language of your choice.
Some possible date formats you could use and how the date August 25, 1965, would be represented follow:
|
|
|
|
|
|
|
|
For your convenience, the following date formats are #defined by the system:
|
|
|
|
|
|