| Constructor and Description |
|---|
UtcOffset(boolean positive,
int hour,
int minute) |
UtcOffset(long millis) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
long |
getMillis()
Gets the offset in milliseconds.
|
int |
hashCode() |
static UtcOffset |
parse(String text)
Parses a UTC offset from a string.
|
static UtcOffset |
parse(TimeZone timezone)
Creates a UTC offset from a
TimeZone object. |
String |
toString()
Converts this offset to its ISO string representation using "basic"
format.
|
String |
toString(boolean extended)
Converts this offset to its ISO string representation.
|
public UtcOffset(boolean positive, int hour, int minute)
positive - true if the offset is positive, false if it is negativehour - the hour component of the offset (the sign of this integer is
ignored)minute - the minute component of the offset (the sign of this
integer is ignored)public UtcOffset(long millis)
millis - the offset in millisecondspublic static UtcOffset parse(String text)
text - the text to parse (e.g. "-0500")IllegalArgumentException - if the text cannot be parsedpublic static UtcOffset parse(TimeZone timezone)
TimeZone object.timezone - the timezonepublic long getMillis()
public String toString()
public String toString(boolean extended)
extended - true to use extended format (e.g. "-05:00"), false to use
basic format (e.g. "-0500")Copyright © 2013-2015 Michael Angstadt. All Rights Reserved.