0

I was just reading the manual do Joda time and it gives the formatting for time object and I don't understand.

This is the link to the manual:

https://www.joda.org/joda-time/userguide.html

It gives the format as below

DateTime dt1 = new DateTime("2004-12-13T21:39:45.618-06:00");

We have: 2004-12-13 date, 06:00 time,

So what is T21:39:45.618-

Thanks for your help

JodaStephen
  • 60,927
  • 15
  • 95
  • 117
Nicholas Muir
  • 2,897
  • 8
  • 39
  • 89
  • 3
    From the very same doc : The initialization string must be in a format that is compatible with the ISO8601 standard. https://en.wikipedia.org/wiki/ISO_8601 – sashok_bg Sep 14 '16 at 12:32
  • 3
    Or from the Javadoc for that constructor: "The String formats are described by ISODateTimeFormat.dateTimeParser()." (And no, 06:00 isn't the time - it's a UTC offset, in this case -6 hours from UTC.) – Jon Skeet Sep 14 '16 at 12:35
  • Awesome thanks very much! – Nicholas Muir Sep 14 '16 at 12:38
  • Offtopic, but why use joda time when there is JDK 8 time? Even the official joda time page says "Joda-Time is the de facto standard date and time library for Java prior to Java SE 8. Users are now asked to migrate to java.time (JSR-310)." – sashok_bg Sep 14 '16 at 12:38
  • @sashok_bg This was my question on stack overflow earlier today: http://stackoverflow.com/questions/39481128/if-i-include-java-8-in-my-android-app-does-that-affect-which-devices-it-will-wor – Nicholas Muir Sep 14 '16 at 12:41

0 Answers0