[threeten-dev] Format of a negative TemporalAmount (Duration/Period)
Stephen Colebourne
scolebourne at joda.org
Thu Jan 8 16:25:56 UTC 2015
JSR-310 will parse both formats, but only produce the first. This is
so that it can handle mixed periods like P1M-2D.
I've seen no evidence that ISO8601 supports any negatives here, but I
could be wrong.
Stephen
On 8 January 2015 at 10:34, Ben Fortuna <benfortuna at gmail.com> wrote:
> Hi,
>
> I have recently started to replace a custom iso8601 implementation with the
> jsr-310 backport. I notice that negative durations/periods are formatted
> like so:
>
> P-2D
>
> However in other specifications (e.g. iCalendar -
> https://tools.ietf.org/html/rfc5545#section-3.3.6) they make reference to
> (supposedly iso8601) durations formatted as follows:
>
> -P2D
>
> I have found other references to iso8601 that place the negative sign at
> the start of the string also, eg:
>
> http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm
>
> I was wondering if you could explain the reason behind the difference in
> formatting negative values, or point me to further discussion (or an
> RFC/specification) on this matter. Many thanks.
>
> regards,
> ben
More information about the threeten-dev
mailing list