Your question is incomprehensible and specific. Perhaps these little examples will help. Mixing the old java.util.Date and .Calendar classes with Joda-Time can be confusing. Joda-Time completely replaces these classes, not additions.
Joda-Time by default uses ISO 8601 for strings, both for parsing and for generating. Joda-Time has built-in default parsers for ISO 8601, so just pass your compatible string to the constructor or static parse method.
java.util.Date date = new DateTime( "2010-01-01T12:00:00+01:00Z" ).toDate();
If possible, avoid java.util.Date and .Calendar and stick with Joda-Time , and these are classes like DateTime . Use .Date only where required for other classes.
DateTime dateTimeUtc = new DateTime( someJavaDotUtilDotDate, DateTimeZone.UTC ); // Joda-Time can convert from java.util.Date type which has no time zone. String output = dateTime.toString(); // Defaults to ISO 8601 format. DateTime dateTimeUtc2 = new DateTime( output, DateTimeZone.UTC ); // Joda-Time can parse ISO 8601 strings.
For the presentation, set the time zone expected by the user.
DateTime dateTimeMontréal = dateTimeUtc.withZone( DateTimeZone.forID( "America/Montreal" ) );
source share