There needs to be support for java.time in java.text.MessageFormat

Nick Williams nicholas+openjdk at nicholaswilliams.net
Mon Jun 17 08:40:52 UTC 2013


On Jun 15, 2013, at 1:34 PM, Nick Williams wrote:

> Currently, MessageFormat /only/ supports SimpleDateFormat and instances of java.util.Date or java.util.Calendar for date/time values. Because of this, it's impossible to use Java 8 date/time types with any of the i18n and localization tools.
> 
> MessageFormat really needs support for types in java.time. Should I file a bug somewhere about this (where?), or is this message enough to get this going? I'm not even sure how it should work. I'm not sure how MessageFormat can know whether a SimpleDateFormat string or a DateTimeFormatter string is being supplied. Possibly, validation of the format string must be delayed until either a Date/Calendar or a java.time type is supplied for formatting.

Looks like there _also_ needs to be java.time support in JAXB. I have a POJO with an @XmlElement "lastModified" of type java.time.Instant, and it just gets printed out <lastModified /> (the value is ignored). It should be printed out ISO 8601-formatted.


More information about the core-libs-dev mailing list