I’m calling toString() (or difference.normalizedStandard().toString()) on a Period object, and getting “PT-10H0.317S“
Why is the default toString so inconvenient? What does this string even mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The period toString is defined in
AbstractPeriod#toString(), which delegates toISOPeriodFormat. Here’s the JavaDoc:…so apparently it’s the ISO 8601 standard format for periods of time. To take manual control of the output, use
org.joda.time.format.PeriodFormatterBuilder.