From benfortuna at gmail.com Thu Jan 8 10:34:13 2015 From: benfortuna at gmail.com (Ben Fortuna) Date: Thu, 8 Jan 2015 21:34:13 +1100 Subject: [threeten-dev] Format of a negative TemporalAmount (Duration/Period) Message-ID: 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 From scolebourne at joda.org Thu Jan 8 16:25:56 2015 From: scolebourne at joda.org (Stephen Colebourne) Date: Thu, 8 Jan 2015 16:25:56 +0000 Subject: [threeten-dev] Format of a negative TemporalAmount (Duration/Period) In-Reply-To: References: Message-ID: 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 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