Time format strings are used by the Vermont Views system to allow flexibility in entering times in a variety of formats. By using a time format string, you can allow the entry and storage of times from hours:minutes:seconds to hours:minutes to any number of other formats.
A time format string is composed of the following control characters:
| H | Represents a numeric hour. There can be from 2 to 6 Hs in a time format string. |
| M | Represents a numeric minute. There can be 2 Ms in a time format string. |
| S | Represents a numeric second. There can only be 2 Ss in the string. |
| am | Indicates that a 12-hour clock should be used. "am" will be appended to the time string for times less than noon and "pm" for times after noon. Cannot be used for time format strings without Hs (hours). |
Any character other than H, M, and S can be used as time separators between the hour, minute, and second components of the time, including spaces.
The "am" and "pm" strings are stored in the array of information messages in vv_infomsg.c. These strings are indexed with the #defined values of AM_STRING and PM_STRING.
For international compatibility, you can change the strings in the array to the language of your choice.
Some possible time formats you could use and how the time half past one o'clock in the afternoon would be represented:
| HH:MM:SS | 13:30:00 |
| HH:MM | 13:30 |
| HH:MM am | 01:30 pm |
| MM:SS | 30:00 |