public final class DateTimeOffset extends Object implements Serializable, Comparable<DateTimeOffset>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DateTimeOffset other)
Compares this DateTimeOffset object with another DateTimeOffset object to determine their relative order.
|
boolean |
equals(Object o) |
int |
getMinutesOffset()
Gets this DateTimeOffset object's offset value.
|
Timestamp |
getTimestamp()
Gets this DateTimeOffset object's timestamp value.
|
int |
hashCode() |
String |
toString()
Formats a datetimeoffset as yyyy-mm-dd hh:mm:ss[.fffffffff] [+|-]hh:mm, where yyyy-mm-dd hh:mm:ss[.fffffffff]
indicates a timestamp that is offset from UTC by the number of minutes indicated by [+|-]hh:mm.
|
static DateTimeOffset |
valueOf(Timestamp timestamp,
Calendar calendar) |
static DateTimeOffset |
valueOf(Timestamp timestamp,
int minutesOffset) |
public static DateTimeOffset valueOf(Timestamp timestamp, int minutesOffset)
public static DateTimeOffset valueOf(Timestamp timestamp, Calendar calendar)
public String toString()
public Timestamp getTimestamp()
The returned value represents an instant in time as the number of milliseconds since January 1, 1970, 00:00:00 GMT.
public int getMinutesOffset()
public int compareTo(DateTimeOffset other)
The ordering is based on the timestamp component only. The offset component is not compared. Two DateTimeOffset objects are considered equivalent with respect to ordering as long as they represent the same moment in time, regardless of the location of the event. This is how SQL Server orders DATETIMEOFFSET values.
compareTo
in interface Comparable<DateTimeOffset>
Copyright © 2016. All rights reserved.