Durations and Timestamps instead.@Deprecated public final class TimeUtil extends 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 com.google.protobuf.Duration |
add(com.google.protobuf.Duration d1,
com.google.protobuf.Duration d2)
Deprecated.
|
static com.google.protobuf.Timestamp |
add(com.google.protobuf.Timestamp start,
com.google.protobuf.Duration length)
Deprecated.
|
static com.google.protobuf.Duration |
createDurationFromMicros(long microseconds)
Deprecated.
Use
Durations.fromMicros(long) instead. |
static com.google.protobuf.Duration |
createDurationFromMillis(long milliseconds)
Deprecated.
Use
Durations.fromMillis(long) instead. |
static com.google.protobuf.Duration |
createDurationFromNanos(long nanoseconds)
Deprecated.
Use
Durations.fromNanos(long) instead. |
static com.google.protobuf.Timestamp |
createTimestampFromMicros(long microseconds)
Deprecated.
Use
Timestamps.fromMicros(long) instead. |
static com.google.protobuf.Timestamp |
createTimestampFromMillis(long milliseconds)
Deprecated.
Use
Timestamps.fromMillis(long) instead. |
static com.google.protobuf.Timestamp |
createTimestampFromNanos(long nanoseconds)
Deprecated.
Use
Timestamps.fromNanos(long) instead. |
static com.google.protobuf.Duration |
distance(com.google.protobuf.Timestamp from,
com.google.protobuf.Timestamp to)
Deprecated.
|
static com.google.protobuf.Duration |
divide(com.google.protobuf.Duration duration,
double value)
Deprecated.
|
static long |
divide(com.google.protobuf.Duration d1,
com.google.protobuf.Duration d2)
Deprecated.
|
static com.google.protobuf.Duration |
divide(com.google.protobuf.Duration duration,
long times)
Deprecated.
|
static com.google.protobuf.Timestamp |
getCurrentTime()
Deprecated.
Use
Timestamps.fromMillis(System.currentTimeMillis()) instead. |
static com.google.protobuf.Timestamp |
getEpoch()
Deprecated.
Use
Timestamps.fromMillis(0) instead. |
static com.google.protobuf.Duration |
multiply(com.google.protobuf.Duration duration,
double times)
Deprecated.
|
static com.google.protobuf.Duration |
multiply(com.google.protobuf.Duration duration,
long times)
Deprecated.
|
static com.google.protobuf.Duration |
parseDuration(String value)
Deprecated.
Use
Durations.parse(java.lang.String) instead. |
static com.google.protobuf.Timestamp |
parseTimestamp(String value)
Deprecated.
Use
Timestamps.parse(java.lang.String) instead. |
static com.google.protobuf.Duration |
remainder(com.google.protobuf.Duration d1,
com.google.protobuf.Duration d2)
Deprecated.
|
static com.google.protobuf.Duration |
subtract(com.google.protobuf.Duration d1,
com.google.protobuf.Duration d2)
Deprecated.
|
static com.google.protobuf.Timestamp |
subtract(com.google.protobuf.Timestamp start,
com.google.protobuf.Duration length)
Deprecated.
|
static long |
toMicros(com.google.protobuf.Duration duration)
Deprecated.
Use
Durations.toMicros(com.google.protobuf.Duration) instead. |
static long |
toMicros(com.google.protobuf.Timestamp timestamp)
Deprecated.
Use
Timestamps.toMicros(com.google.protobuf.Timestamp) instead. |
static long |
toMillis(com.google.protobuf.Duration duration)
Deprecated.
Use
Durations.toMillis(com.google.protobuf.Duration) instead. |
static long |
toMillis(com.google.protobuf.Timestamp timestamp)
Deprecated.
Use
Timestamps.toMillis(com.google.protobuf.Timestamp) instead. |
static long |
toNanos(com.google.protobuf.Duration duration)
Deprecated.
Use
Durations.toNanos(com.google.protobuf.Duration) instead. |
static long |
toNanos(com.google.protobuf.Timestamp timestamp)
Deprecated.
Use
Timestamps.toNanos(com.google.protobuf.Timestamp) instead. |
static String |
toString(com.google.protobuf.Duration duration)
Deprecated.
Use
Durations.toString(com.google.protobuf.Duration) instead. |
static String |
toString(com.google.protobuf.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 String toString(com.google.protobuf.Timestamp timestamp)
Timestamps.toString(com.google.protobuf.Timestamp) instead.Example of generated format: "1972-01-01T10:00:20.021Z"
IllegalArgumentException - if the given timestamp is not in the
valid range.@Deprecated public static com.google.protobuf.Timestamp parseTimestamp(String value) throws 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"
ParseException - if parsing fails.@Deprecated public static String toString(com.google.protobuf.Duration duration)
Durations.toString(com.google.protobuf.Duration) instead.IllegalArgumentException - if the given duration is not in the valid
range.@Deprecated public static com.google.protobuf.Duration parseDuration(String value) throws ParseException
Durations.parse(java.lang.String) instead.ParseException - if parsing fails.@Deprecated public static com.google.protobuf.Timestamp createTimestampFromMillis(long milliseconds)
Timestamps.fromMillis(long) instead.@Deprecated public static com.google.protobuf.Duration createDurationFromMillis(long milliseconds)
Durations.fromMillis(long) instead.@Deprecated public static long toMillis(com.google.protobuf.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(com.google.protobuf.Duration duration)
Durations.toMillis(com.google.protobuf.Duration) instead.@Deprecated public static com.google.protobuf.Timestamp createTimestampFromMicros(long microseconds)
Timestamps.fromMicros(long) instead.@Deprecated public static com.google.protobuf.Duration createDurationFromMicros(long microseconds)
Durations.fromMicros(long) instead.@Deprecated public static long toMicros(com.google.protobuf.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(com.google.protobuf.Duration duration)
Durations.toMicros(com.google.protobuf.Duration) instead.@Deprecated public static com.google.protobuf.Timestamp createTimestampFromNanos(long nanoseconds)
Timestamps.fromNanos(long) instead.@Deprecated public static com.google.protobuf.Duration createDurationFromNanos(long nanoseconds)
Durations.fromNanos(long) instead.@Deprecated public static long toNanos(com.google.protobuf.Timestamp timestamp)
Timestamps.toNanos(com.google.protobuf.Timestamp) instead.@Deprecated public static long toNanos(com.google.protobuf.Duration duration)
Durations.toNanos(com.google.protobuf.Duration) instead.@Deprecated public static com.google.protobuf.Timestamp getCurrentTime()
Timestamps.fromMillis(System.currentTimeMillis()) instead.@Deprecated public static com.google.protobuf.Timestamp getEpoch()
Timestamps.fromMillis(0) instead.@Deprecated public static com.google.protobuf.Duration distance(com.google.protobuf.Timestamp from, com.google.protobuf.Timestamp to)
Timestamps.between(com.google.protobuf.Timestamp, com.google.protobuf.Timestamp) instead.@Deprecated public static com.google.protobuf.Timestamp add(com.google.protobuf.Timestamp start, com.google.protobuf.Duration length)
Timestamps.add(com.google.protobuf.Timestamp, com.google.protobuf.Duration) instead.@Deprecated public static com.google.protobuf.Timestamp subtract(com.google.protobuf.Timestamp start, com.google.protobuf.Duration length)
Timestamps.subtract(com.google.protobuf.Timestamp, com.google.protobuf.Duration) instead.@Deprecated public static com.google.protobuf.Duration add(com.google.protobuf.Duration d1, com.google.protobuf.Duration d2)
Durations.add(com.google.protobuf.Duration, com.google.protobuf.Duration) instead.@Deprecated public static com.google.protobuf.Duration subtract(com.google.protobuf.Duration d1, com.google.protobuf.Duration d2)
Durations.subtract(com.google.protobuf.Duration, com.google.protobuf.Duration) instead.public static com.google.protobuf.Duration multiply(com.google.protobuf.Duration duration,
double times)
public static com.google.protobuf.Duration divide(com.google.protobuf.Duration duration,
double value)
public static com.google.protobuf.Duration multiply(com.google.protobuf.Duration duration,
long times)
public static com.google.protobuf.Duration divide(com.google.protobuf.Duration duration,
long times)
public static long divide(com.google.protobuf.Duration d1,
com.google.protobuf.Duration d2)
public static com.google.protobuf.Duration remainder(com.google.protobuf.Duration d1,
com.google.protobuf.Duration d2)
Copyright © 2008–2016 Google. All rights reserved.