Well, there is no direct way to get the offset of a timezone such as -08:00 from the DateTime object. The only solution that I found working was to format it by using the DateTimeFormat class.
Here is how to do it:
|
1 2 |
DateTimeFormatter dtf = DateTimeFormat.forPattern("ZZ"); System.out.println(dtf.withZone(DateTimeZone.forID("America/Los_Angeles")).print(0)); |