How to get the timezone from a date object of the system in java ? Like EST,PST,MST.
Asked
Active
Viewed 45 times
2 Answers
1
java.util.Date
does not contain timezone information. You can check this post for some options.

Community
- 1
- 1

Predrag Maric
- 23,938
- 5
- 52
- 68
1
Java Date class can't get timezone directly.
You can see more details as below link.
http://stackoverflow.com/questions/1305350/how-to-get-the-current-date-and-time-of-your-timezone-in-java
Following is the way to get timezone using java.
Calendar calendar = new GregorianCalendar();
TimeZone timeZone = calendar.getTimeZone();
More details about timezone, here.

Ye Win
- 2,020
- 14
- 21