Constructor and Description |
---|
UtcOffset(int millis)
Creates a new UTC offset.
|
UtcOffset(int hour,
int minute)
Creates a new UTC offset.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getHour()
Gets the hour component.
|
int |
getMinute()
Gets the minute component.
|
int |
hashCode() |
static UtcOffset |
parse(String text)
Parses a UTC offset from a string.
|
int |
toMillis()
Converts the offset to milliseconds.
|
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(int hour, int minute)
hour
- the hour component (may be negative)minute
- the minute component (must be between 0 and 59)public UtcOffset(int 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 int getHour()
public int getMinute()
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")public int toMillis()
Copyright © 2013-2015 Michael Angstadt. All Rights Reserved.