public final class TimeUtil
extends java.lang.Object
Dataflow API times are strings of the form
YYYY-MM-dd'T'HH:mm:ss[.nnnn]'Z'
: that is, RFC 3339
strings with optional fractional seconds and a 'Z' offset.
Dataflow API durations are strings of the form ['-']sssss[.nnnn]'s'
:
that is, seconds with optional fractional seconds and a literal 's' at the end.
In both formats, fractional seconds are either three digits (millisecond resolution), six digits (microsecond resolution), or nine digits (nanosecond resolution).
Modifier and Type | Method and Description |
---|---|
static Duration |
fromCloudDuration(java.lang.String duration)
Converts a Dataflow API duration string into a
Duration . |
static Instant |
fromCloudTime(java.lang.String time)
Converts a time value received via the Dataflow API into the corresponding
Instant . |
static java.lang.String |
toCloudDuration(ReadableDuration duration)
Converts a
ReadableDuration into a Dataflow API duration string. |
static java.lang.String |
toCloudTime(ReadableInstant instant)
Converts a
ReadableInstant into a Dateflow API time value. |
public static java.lang.String toCloudTime(ReadableInstant instant)
ReadableInstant
into a Dateflow API time value.@Nullable public static Instant fromCloudTime(java.lang.String time)
Instant
.public static java.lang.String toCloudDuration(ReadableDuration duration)
ReadableDuration
into a Dataflow API duration string.