Parsing Joda-Time Partials

前端 未结 3 1495
难免孤独
难免孤独 2021-01-18 14:49

I\'d like to produce Partials from Strings, but can\'t find anything in the API that supports that. Obviously, I can write my own parser outside of the Joda-Time framework

3条回答
  •  难免孤独
    2021-01-18 15:00

    The ISODateTimeFormat class allows partial printing. As you say, there is no parsing method on DateTimeFormatter (although you can parse to a LocalDate and interpret that).

    ThreeTen/JSR-310 has the DateTimeFields class which replaces Partial. Parsing of partials into a CalendricalMerger is supported, however that may not be convertable back into a DateTimeFields yet.

提交回复
热议问题