datepat.json - Date Patterns
Details
This is a map of codes to date patterns. You should not hard-code specific patterns: instead, use this map to get the appropriate pattern for the user's locale.
The code consists of a base pattern code and modifier codes separated by underscores.
Base code is one of SHORT
, MEDIUM
, LONG
and FULL
.
Modifier codes are:
- CENTURY - use a 4-digit year. example
- NODAY - skip the day portion. example
- NOYEAR - skip the year portion. example
- PADDED - pad the day and month to two digits. example
- WEEKDAY - add the short version of the day of the week example
The patterns are from Java's java.text.SimpleDateFormat.
You can use more "JavaScript-style" codes: lower-case with colon (':') separators.
You can view the results across available locales on the Compare Date Patterns page.
Sample
datepat.json?pat=SHORT%2CSHORT_CENTURY
Field | Value |
---|