public class Timestamp
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Timestamp |
create(long seconds,
int nanos)
Creates a new timestamp from given seconds and nanoseconds.
|
boolean |
equals(java.lang.Object obj) |
static Timestamp |
fromMillis(long millis)
Creates a new timestamp from given milliseconds.
|
int |
getNanos()
Returns the number of nanoseconds after the number of seconds since the Unix Epoch represented
by this timestamp.
|
long |
getSeconds()
Returns the number of seconds since the Unix Epoch represented by this timestamp.
|
int |
hashCode() |
java.lang.String |
toString() |
public static Timestamp create(long seconds, int nanos)
seconds - Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
be from from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.nanos - Non-negative fractions of a second at nanosecond resolution. Negative
second values with fractions must still have non-negative nanos values that count forward
in time. Must be from 0 to 999,999,999 inclusive.Timestamp with specified fields. For invalid inputs, a Timestamp
of zero is returned.public static Timestamp fromMillis(long millis)
public long getSeconds()
public int getNanos()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object