views:

175

answers:

1

Hi, According to their website, the class DUration implements the ISO 8601

http://en.wikipedia.org/wiki/ISO%5F8601#Durations

But let see an example. It is a duration of 14min & 51sec. In ISO 8601 those code are equivalent :

    PT14M51S
    PT891S
    System.out.println("bug "+new Duration("PT14M51S"));
     System.out.println("NO bug "+new Duration("PT891S");

The PT14M51S is a real extract for a postgresql database & correct. The joda-time api just convert everything in sec why ?It seems to dont know anything elese than the keyletter S(theres Y, M, D...)

Thanks in advance

+3  A: 

You need:

System.out.println("bug "+new Period("PT14M51S"));
JodaStephen