Is the syntax of date-time format strings as defined in Java's SimpleDateFormat class (like "EEE, MMM d, ''yy"
and such) an original Java invention, or is it based on some other syntax definition like ICU's or CLDR's?!
Is anybody aware of work that compares SimpleDateFormat syntax to those other definitions?
SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows for formatting (date -> text), parsing (text -> date), and normalization. SimpleDateFormat allows you to start by choosing any user-defined patterns for date-time formatting.
Java SimpleDateFormat Example String pattern = "MM-dd-yyyy"; SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); String date = simpleDateFormat. format(new Date()); System. out. println(date);
Return Value: The method returns Date or time in string format of mm/dd/yyyy.
java.text.*
, introduced in JDK 1.1., was based on ICU:
ICU was originally developed by the Unicode group at the IBM Globalization Center of Competency in Cupertino, and ICU was contributed to Sun for inclusion into the JDK 1.1. ICU4J includes enhanced versions of some of these contributed classes plus additional classes that complement the classes in the JDK.
ICUs own SimpleDateFormat states that its symbols are based on "algorithm and pattern letters defined by UTS#35 Unicode Locale Data Markup Language (LDML)", which can be found here.
Interestingly the Date-Pattern chapter was introduced into the Unicode Technical Report #35 in Revision 3 from 2004-10-27. Maybe ICU was then the original author?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With