Given a DateTimeZone
, I can get the name and ID of the TimeZone like this:
DateTimeZone timeZone = new DateTimeZone("America/Chicago");
// Prints "America/Chicago"
System.out.println(timeZone.getID());
// Prints "CDT" (Since it is daylight savings time now)
System.out.println(timeZone.getNameKey(DateTimeUtils.currentTimeMillis()));
// Prints "Central Daylight Time"
System.out.println(timeZone.getName(DateTimeUtils.currentTimeMillis()));
All are great, but I really would like to get the timezone as a UTC offset. In this case the UTC offset would look like -05:00
How do I do this with Joda-Time?