The Java TimeZone class is a class that represents time zones, and is helpful when doing calendar arithmetics across time zones. The java.util.TimeZone Here is a simple example of how you can get the TimeZone And here is how you can set it: calendar.setTimeZone(timeZone); TimeZone instance: The first method ( TimeZone.getDefault() ) returns the default time zone for the system (computer) this program is running on. The second method ( TimeZone corresponding to the given time zone ID (in this example "Europe/Copenhagen").
Read full article from Java's java.util.TimeZone
No comments:
Post a Comment