Lines Matching refs:timeZone
28 * {@code TimeZone} represents a time zone, primarily used for configuring a {@link Calendar} or
31 * <p>Most applications will use {@link #getDefault} which returns a {@code TimeZone} based on
34 * <p>You can also get a specific {@code TimeZone} {@link #getTimeZone by Olson ID}.
64 public abstract class TimeZone implements Serializable, Cloneable {
81 private static final TimeZone GMT = new SimpleTimeZone(0, "GMT");
82 private static final TimeZone UTC = new SimpleTimeZone(0, "UTC");
84 private static TimeZone defaultTimeZone;
88 public TimeZone() {}
129 public static synchronized TimeZone getDefault() {
133 return (TimeZone) defaultTimeZone.clone();
137 * Equivalent to {@code getDisplayName(false, TimeZone.LONG, Locale.getDefault())}.
145 * Equivalent to {@code getDisplayName(false, TimeZone.LONG, locale)}.
166 * @param style either {@link TimeZone#LONG} or {@link TimeZone#SHORT}.
219 * Returns the ID of this {@code TimeZone}, such as
239 * tells you that this {@code TimeZone} sometimes observes daylight savings.
289 * Returns a {@code TimeZone} corresponding to the given {@code id}, or {@code GMT}
296 * <p>This method can also create a custom {@code TimeZone} given an ID with the following
307 public static synchronized TimeZone getTimeZone(String id) {
316 return (TimeZone) GMT.clone();
319 return (TimeZone) UTC.clone();
324 TimeZone zone = null;
336 return (zone != null) ? zone : (TimeZone) GMT.clone();
342 private static TimeZone getCustomTimeZone(String id) {
374 * Returns true if {@code timeZone} has the same rules as this time zone.
379 public boolean hasSameRules(TimeZone timeZone) {
380 if (timeZone == null) {
383 return getRawOffset() == timeZone.getRawOffset();
400 * @param timeZone a custom time zone, or {@code null} to set the default to
403 public static synchronized void setDefault(TimeZone timeZone) {
404 defaultTimeZone = timeZone != null ? (TimeZone) timeZone.clone() : null;
408 * Sets the ID of this {@code TimeZone}.