webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Static Public Member Functions | |
static String | toString (Timestamp timestamp) throws IllegalArgumentException |
static Timestamp | parseTimestamp (String value) throws ParseException |
static String | toString (Duration duration) throws IllegalArgumentException |
static Duration | parseDuration (String value) throws ParseException |
static Timestamp | createTimestampFromMillis (long milliseconds) |
static Duration | createDurationFromMillis (long milliseconds) |
static long | toMillis (Timestamp timestamp) |
static long | toMillis (Duration duration) |
static Timestamp | createTimestampFromMicros (long microseconds) |
static Duration | createDurationFromMicros (long microseconds) |
static long | toMicros (Timestamp timestamp) |
static long | toMicros (Duration duration) |
static Timestamp | createTimestampFromNanos (long nanoseconds) |
static Duration | createDurationFromNanos (long nanoseconds) |
static long | toNanos (Timestamp timestamp) |
static long | toNanos (Duration duration) |
static Timestamp | getCurrentTime () |
static Timestamp | getEpoch () |
static Duration | distance (Timestamp from, Timestamp to) |
static Timestamp | add (Timestamp start, Duration length) |
static Timestamp | subtract (Timestamp start, Duration length) |
static Duration | add (Duration d1, Duration d2) |
static Duration | subtract (Duration d1, Duration d2) |
static Duration | multiply (Duration duration, double times) |
static Duration | divide (Duration duration, double value) |
static Duration | multiply (Duration duration, long times) |
static Duration | divide (Duration duration, long times) |
static long | divide (Duration d1, Duration d2) |
static Duration | remainder (Duration d1, Duration d2) |
Static Public Attributes | |
static final long | TIMESTAMP_SECONDS_MIN = -62135596800L |
static final long | TIMESTAMP_SECONDS_MAX = 253402300799L |
static final long | DURATION_SECONDS_MIN = -315576000000L |
static final long | DURATION_SECONDS_MAX = 315576000000L |
Utilities to help create/manipulate Timestamp/Duration
|
inlinestatic |
Add a duration to a timestamp.
|
inlinestatic |
Add two durations.
|
inlinestatic |
Create a Duration from the number of microseconds.
|
inlinestatic |
Create a Duration from the number of milliseconds.
|
inlinestatic |
Create a Duration from the number of nanoseconds.
|
inlinestatic |
Create a Timestamp from the number of microseconds elapsed from the epoch.
|
inlinestatic |
Create a Timestamp from the number of milliseconds elapsed from the epoch.
|
inlinestatic |
Create a Timestamp from the number of nanoseconds elapsed from the epoch.
|
inlinestatic |
Calculate the difference between two timestamps.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Get the current time.
|
inlinestatic |
Get the epoch.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Parse from a string to produce a duration.
ParseException | if parsing fails. |
|
inlinestatic |
Parse from RFC 3339 date string to Timestamp. This method accepts all outputs of 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. |
|
inlinestatic |
|
inlinestatic |
Subtract a duration from a timestamp.
|
inlinestatic |
Subtract a duration from another.
|
inlinestatic |
Convert a Timestamp to the number of microseconds elapsed from the epoch.
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.
|
inlinestatic |
Convert a Duration to the number of microseconds.The result will be rounded towards 0 to the nearest microseconds. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.
|
inlinestatic |
Convert a Timestamp to the number of milliseconds elapsed from the epoch.
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.
|
inlinestatic |
Convert a Duration to the number of milliseconds.The result will be rounded towards 0 to the nearest millisecond. E.g., if the duration represents -1 nanosecond, it will be rounded to 0.
|
inlinestatic |
Convert a Timestamp to the number of nanoseconds elapsed from the epoch.
|
inlinestatic |
Convert a Duration to the number of nanoseconds.
|
inlinestatic |
Convert Timestamp to RFC 3339 date string format. The output will always be Z-normalized and uses 3, 6 or 9 fractional digits as required to represent the exact value. Note that Timestamp can only represent time from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. See https://www.ietf.org/rfc/rfc3339.txt
Example of generated format: "1972-01-01T10:00:20.021Z"
IllegalArgumentException | if the given timestamp is not in the valid range. |
|
inlinestatic |
Convert Duration to string format. The string format will contains 3, 6, or 9 fractional digits depending on the precision required to represent the exact Duration value. For example: "1s", "1.010s", "1.000000100s", "-3.100s" The range that can be represented by Duration is from -315,576,000,000 to +315,576,000,000 inclusive (in seconds).
IllegalArgumentException | if the given duration is not in the valid range. |
|
static |
|
static |
|
static |
|
static |