The Zend Framework comes with a Zend_Locale
class which in turn accesses a bunch of XML files in Unicode Locale Data Markup Language (LDML). Those contain, among lots of other things, localized date formats. Take a look at the Unicode Common Locale Data Repository (CLDR) for more information.
As an example, the XML file for German would contain stuff like
<dateFormats>
<dateFormatLength type="full">
<dateFormat>
<pattern>EEEE, d. MMMM yyyy</pattern>
</dateFormat>
</dateFormatLength>
<dateFormatLength type="long">
<dateFormat>
<pattern>d. MMMM yyyy</pattern>
</dateFormat>
</dateFormatLength>
<dateFormatLength type="medium">
<dateFormat>
<pattern>dd.MM.yyyy</pattern>
</dateFormat>
</dateFormatLength>
<dateFormatLength type="short">
<dateFormat>
<pattern>dd.MM.yy</pattern>
</dateFormat>
</dateFormatLength>
</dateFormats>
Now, I haven't used this myself, but from briefly browsing through it I'd guess that Zend_Locale_Data::getContent()
is your friend and should give you all the information you need.
If you don't wanna use ZF you can just access these files directly with the XML parser of your choice (you can probably find the XML files somewhere on unicode.org
).