Class CivilTimeEncoder
java.lang.Object
com.google.cloud.bigquery.storage.v1beta2.CivilTimeEncoder
Deprecated.
Ported from ZetaSQL CivilTimeEncoder Original code can be found at:
https://github.com/google/zetasql/blob/master/java/com/google/zetasql/CivilTimeEncoder.java
Encoder for TIME and DATETIME values, according to civil_time encoding.
The valid range and number of bits required by each date/time field is as the following:
Field | Range | #Bits |
---|---|---|
Year | [1, 9999] | 14 |
Month | [1, 12] | 4 |
Day | [1, 31] | 5 |
Hour | [0, 23] | 5 |
Minute | [0, 59] | 6 |
Second | [0, 59]* | 6 |
Micros | [0, 999999] | 20 |
Nanos | [0, 999999999] | 30 |
* Leap second is not supported.
When encoding the TIME or DATETIME into a bit field, larger date/time field is on the more significant side.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.threeten.bp.LocalDateTime
decodePacked64DatetimeMicros
(long bitFieldDatetimeMicros) Deprecated.DecodesbitFieldDatetimeMicros
as aLocalDateTime
with microseconds precision.static org.threeten.bp.LocalTime
decodePacked64TimeMicros
(long bitFieldTimeMicros) Deprecated.DecodesbitFieldTimeMicros
as aLocalTime
with microseconds precision.static long
encodePacked64DatetimeMicros
(org.threeten.bp.LocalDateTime dateTime) Deprecated.EncodesdateTime
as a 8-byte integer with microseconds precision.static long
encodePacked64TimeMicros
(org.threeten.bp.LocalTime time) Deprecated.Encodestime
as a 8-byte integer with microseconds precision.
-
Method Details
-
encodePacked64TimeMicros
public static long encodePacked64TimeMicros(org.threeten.bp.LocalTime time) Deprecated.Encodestime
as a 8-byte integer with microseconds precision.Encoding is as the following:
6 5 4 3 2 1 MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB | H || M || S ||-------micros-----|
-
decodePacked64TimeMicros
public static org.threeten.bp.LocalTime decodePacked64TimeMicros(long bitFieldTimeMicros) Deprecated.DecodesbitFieldTimeMicros
as aLocalTime
with microseconds precision.Encoding is as the following:
6 5 4 3 2 1 MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB | H || M || S ||-------micros-----|
- See Also:
-
encodePacked64DatetimeMicros
public static long encodePacked64DatetimeMicros(org.threeten.bp.LocalDateTime dateTime) Deprecated.EncodesdateTime
as a 8-byte integer with microseconds precision.Encoding is as the following:
6 5 4 3 2 1 MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB |--- year ---||m || D || H || M || S ||-------micros-----|
- See Also:
-
decodePacked64DatetimeMicros
public static org.threeten.bp.LocalDateTime decodePacked64DatetimeMicros(long bitFieldDatetimeMicros) Deprecated.DecodesbitFieldDatetimeMicros
as aLocalDateTime
with microseconds precision.Encoding is as the following:
6 5 4 3 2 1 MSB 3210987654321098765432109876543210987654321098765432109876543210 LSB |--- year ---||m || D || H || M || S ||-------micros-----|
-