Reputation: 816
I noticed, that when formatting a date with PHP's IntlDateFormatter
the result can be very different depending on the language. Example:
$formatter = new IntlDateFormatter("en_GB",
IntlDateFormatter::SHORT, IntlDateFormatter::NONE,
"Europe/Vienna");
$date = $formatter->format(0);
In this example $date
will be 31/12/1969
but if I use de_DE as a locale $date
is 31.12.69
. The different is bigger when using IntlDateFormatter::MEDIUM
:
31.12.1969
31 Dec 1969
Is there a way to get more similar results without specifying the format?
Upvotes: 2
Views: 1071
Reputation: 1984
As ICU docs say:
- SHORT is numeric, such as 12/13/52 or 3:30pm
- MEDIUM is longer, such as Jan. 12, 1952
- LONG is longer, such as January 12, 1952 or 3:30:32pm
- FULL is completely specified, such as Tuesday, April 12, 1952 AD or 3:30:42pm PST
So probably you're right with rising questions like: "who defines those short/medium formats, and who decide about how it looks like?".
All decision like that are confirmed by CLDR, and their process is described as:
Once data for a country and language has been received, the data from the different sources will be compared to show agreements and differences. Initial data contributions are normally marked as draft; this may be changed once the data is vetted.
Note that there are two types of data in the repository:
- Common Data: The contents is decided upon by the CLDR Technical Committee, following its procedures and this process.
- Comparison data: The contributor can be an individual or an organization. Data is normally gathered by calling public APIs, to ensure that the data matches what is actually in use. The data is only for comparison, and will not be changed except where necessary to update the data to match the external source. The only requirement is that all changed data be versioned, and the Version Numbering Scheme be used.
Contributors are encouraged to use local language and country contacts, inside and outside their organization, to help vet current common data and any new proposals for addition or amendment of common data. In particular, national standards organizations are encouraged to be involved in the data vetting process.
Probably, not always(all over the world) medium format would look like: 12, Jan 2015
, and decisions are made on country level. If you, as German, have concerns about it - you can try to fill a ticket with change proposal.
Upvotes: 1