Durations
and Timestamps
instead.@Deprecated
public final class TimeUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DURATION_SECONDS_MAX
Deprecated.
|
static long |
DURATION_SECONDS_MIN
Deprecated.
|
static long |
TIMESTAMP_SECONDS_MAX
Deprecated.
|
static long |
TIMESTAMP_SECONDS_MIN
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Duration |
add(Duration d1,
Duration d2)
Deprecated.
|
static Timestamp |
add(Timestamp start,
Duration length)
Deprecated.
|
static Duration |
createDurationFromMicros(long microseconds)
Deprecated.
Use
Durations.fromMicros(long) instead. |
static Duration |
createDurationFromMillis(long milliseconds)
Deprecated.
Use
Durations.fromMillis(long) instead. |
static Duration |
createDurationFromNanos(long nanoseconds)
Deprecated.
Use
Durations.fromNanos(long) instead. |
static Timestamp |
createTimestampFromMicros(long microseconds)
Deprecated.
Use
Timestamps.fromMicros(long) instead. |
static Timestamp |
createTimestampFromMillis(long milliseconds)
Deprecated.
Use
Timestamps.fromMillis(long) instead. |
static Timestamp |
createTimestampFromNanos(long nanoseconds)
Deprecated.
Use
Timestamps.fromNanos(long) instead. |
static Duration |
distance(Timestamp from,
Timestamp to)
Deprecated.
|
static Duration |
divide(Duration duration,
double value)
Deprecated.
|
static long |
divide(Duration d1,
Duration d2)
Deprecated.
|
static Duration |
divide(Duration duration,
long times)
Deprecated.
|
static Timestamp |
getCurrentTime()
Deprecated.
Use
Timestamps.fromMillis(System.currentTimeMillis()) instead. |
static Timestamp |
getEpoch()
Deprecated.
Use
Timestamps.fromMillis(0) instead. |
static Duration |
multiply(Duration duration,
double times)
Deprecated.
|
static Duration |
multiply(Duration duration,
long times)
Deprecated.
|
static Duration |
parseDuration(java.lang.String value)
Deprecated.
Use
Durations.parse(java.lang.String) instead. |
static Timestamp |
parseTimestamp(java.lang.String value)
Deprecated.
Use
Timestamps.parse(java.lang.String) instead. |
static Duration |
remainder(Duration d1,
Duration d2)
Deprecated.
|
static Duration |
subtract(Duration d1,
Duration d2)
Deprecated.
|
static Timestamp |
subtract(Timestamp start,
Duration length)
Deprecated.
|
static long |
toMicros(Duration duration)
Deprecated.
Use
Durations.toMicros(com.google.protobuf.Duration) instead. |
static long |
toMicros(Timestamp timestamp)
Deprecated.
Use
Timestamps.toMicros(com.google.protobuf.Timestamp) instead. |
static long |
toMillis(Duration duration)
Deprecated.
Use
Durations.toMillis(com.google.protobuf.Duration) instead. |
static long |
toMillis(Timestamp timestamp)
Deprecated.
Use
Timestamps.toMillis(com.google.protobuf.Timestamp) instead. |
static long |
toNanos(Duration duration)
Deprecated.
Use
Durations.toNanos(com.google.protobuf.Duration) instead. |
static long |
toNanos(Timestamp timestamp)
Deprecated.
Use
Timestamps.toNanos(com.google.protobuf.Timestamp) instead. |
static java.lang.String |
toString(Duration duration)
Deprecated.
Use
Durations.toString(com.google.protobuf.Duration) instead. |
static java.lang.String |
toString(Timestamp timestamp)
Deprecated.
Use
Timestamps.toString(com.google.protobuf.Timestamp) instead. |
public static final long TIMESTAMP_SECONDS_MIN
public static final long TIMESTAMP_SECONDS_MAX
public static final long DURATION_SECONDS_MIN
public static final long DURATION_SECONDS_MAX
@Deprecated public static java.lang.String toString(Timestamp timestamp)
Timestamps.toString(com.google.protobuf.Timestamp)
instead.Example of generated format: "1972-01-01T10:00:20.021Z"
java.lang.IllegalArgumentException
- if the given timestamp is not in the
valid range.@Deprecated public static Timestamp parseTimestamp(java.lang.String value) throws java.text.ParseException
Timestamps.parse(java.lang.String)
instead.toString(Timestamp)
and it also accepts any fractional
digits (or none) and any offset as long as they fit into nano-seconds
precision.
Example of accepted format: "1972-01-01T10:00:20.021-05:00"
java.text.ParseException
- if parsing fails.@Deprecated public static java.lang.String toString(Duration duration)
Durations.toString(com.google.protobuf.Duration)
instead.java.lang.IllegalArgumentException
- if the given duration is not in the valid
range.@Deprecated public static Duration parseDuration(java.lang.String value) throws java.text.ParseException
Durations.parse(java.lang.String)
instead.java.text.ParseException
- if parsing fails.@Deprecated public static Timestamp createTimestampFromMillis(long milliseconds)
Timestamps.fromMillis(long)
instead.@Deprecated public static Duration createDurationFromMillis(long milliseconds)
Durations.fromMillis(long)
instead.@Deprecated public static long toMillis(Timestamp timestamp)
Timestamps.toMillis(com.google.protobuf.Timestamp)
instead.The result will be rounded down to the nearest millisecond. E.g., if the timestamp represents "1969-12-31T23:59:59.999999999Z", it will be rounded to -1 millisecond.
@Deprecated public static long toMillis(Duration duration)
Durations.toMillis(com.google.protobuf.Duration)
instead.@Deprecated public static Timestamp createTimestampFromMicros(long microseconds)
Timestamps.fromMicros(long)
instead.@Deprecated public static Duration createDurationFromMicros(long microseconds)
Durations.fromMicros(long)
instead.@Deprecated public static long toMicros(Timestamp timestamp)
Timestamps.toMicros(com.google.protobuf.Timestamp)
instead.The result will be rounded down to the nearest microsecond. E.g., if the timestamp represents "1969-12-31T23:59:59.999999999Z", it will be rounded to -1 millisecond.
@Deprecated public static long toMicros(Duration duration)
Durations.toMicros(com.google.protobuf.Duration)
instead.@Deprecated public static Timestamp createTimestampFromNanos(long nanoseconds)
Timestamps.fromNanos(long)
instead.@Deprecated public static Duration createDurationFromNanos(long nanoseconds)
Durations.fromNanos(long)
instead.@Deprecated public static long toNanos(Timestamp timestamp)
Timestamps.toNanos(com.google.protobuf.Timestamp)
instead.@Deprecated public static long toNanos(Duration duration)
Durations.toNanos(com.google.protobuf.Duration)
instead.@Deprecated public static Timestamp getCurrentTime()
Timestamps.fromMillis(System.currentTimeMillis())
instead.@Deprecated public static Timestamp getEpoch()
Timestamps.fromMillis(0)
instead.@Deprecated public static Duration distance(Timestamp from, Timestamp to)
Timestamps.between(com.google.protobuf.Timestamp, com.google.protobuf.Timestamp)
instead.@Deprecated public static Timestamp add(Timestamp start, Duration length)
Timestamps.add(com.google.protobuf.Timestamp, com.google.protobuf.Duration)
instead.@Deprecated public static Timestamp subtract(Timestamp start, Duration length)
Timestamps.subtract(com.google.protobuf.Timestamp, com.google.protobuf.Duration)
instead.@Deprecated public static Duration add(Duration d1, Duration d2)
Durations.add(com.google.protobuf.Duration, com.google.protobuf.Duration)
instead.@Deprecated public static Duration subtract(Duration d1, Duration d2)
Durations.subtract(com.google.protobuf.Duration, com.google.protobuf.Duration)
instead.