getLocaleTimeFormat
Time format that depends on the locale.
getLocaleTimeFormat(locale: string, width: FormatWidth): string
Parameters
| locale |
Type: |
| width |
Type: |
Returns
string
Description
The standard formats include four basic time formats:
fullshould contain hour (h/H), minute (mm), second (ss), and zone (zzzz).longshould contain hour, minute, second, and zone (z)mediumshould contain hour, minute, second.shortshould contain hour, minute.
Note: The patterns depend on whether the main country using your language uses 12-hour time or not:
- For 12-hour time, use a pattern like
hh:mm ausing h to mean a 12-hour clock cycle running 1 through 12 (midnight plus 1 minute is 12:01), or using K to mean a 12-hour clock cycle running 0 through 11 (midnight plus 1 minute is 0:01). - For 24-hour time, use a pattern like
HH:mmusing H to mean a 24-hour clock cycle running 0 through 23 (midnight plus 1 minute is 0:01), or using k to mean a 24-hour clock cycle running 1 through 24 (midnight plus 1 minute is 24:01).