A time of day, stored as nanoseconds since midnight, [0, 86400e9 - 1]. Holds any Parquet TIME unit (seconds/millis/micros/nanos) exactly. A default-initialized element is null.
Constructs a valid parquet_time from (hour, minute, second[, nanosecond]); aborts on invalid fields.
Constructor specific for the parquet_time generic: builds a valid time element from (hour, minute, second[, nanosecond]); aborts on invalid fields.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | hour |
hour, 0..23. |
||
| integer(kind=int32), | intent(in) | :: | minute |
minute, 0..59. |
||
| integer(kind=int32), | intent(in) | :: | second |
second, 0..59. |
||
| integer(kind=int32), | intent(in), | optional | :: | nanosecond |
sub-second part, 0..999999999 (default 0). |
the constructed element (valid).
Sets from validated (hour, minute, second[, nanosecond]).
Sets the element from validated time-of-day fields; marks it valid. Leap seconds (second == 60) are not representable (Parquet/Arrow TIME does not support them).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(inout) | :: | self |
receives the time (marked valid). |
||
| integer(kind=int32), | intent(in) | :: | hour |
hour, 0..23. |
||
| integer(kind=int32), | intent(in) | :: | minute |
minute, 0..59. |
||
| integer(kind=int32), | intent(in) | :: | second |
second, 0..59. |
||
| integer(kind=int32), | intent(in), | optional | :: | nanosecond |
sub-second part, 0..999999999 (default 0). |
Returns hour, minute, second[, nanosecond] (aborts on null).
Returns the time-of-day fields of the element; aborts on a null element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
||
| integer(kind=int32), | intent(out) | :: | hour |
hour, 0..23. |
||
| integer(kind=int32), | intent(out) | :: | minute |
minute, 0..59. |
||
| integer(kind=int32), | intent(out) | :: | second |
second, 0..59. |
||
| integer(kind=int32), | intent(out), | optional | :: | nanosecond |
sub-second part, 0..999999999. |
Hour 0..23 (aborts on null).
Returns the hour (0..23); aborts on a null element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
Minute 0..59 (aborts on null).
Returns the minute (0..59); aborts on a null element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
Second 0..59 (aborts on null).
Returns the second (0..59); aborts on a null element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
Sub-second part 0..999999999 (aborts on null).
Returns the sub-second part in nanoseconds (0..999999999); aborts on a null element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
Whether the element is null (never aborts).
Returns whether the element is null (the primary null guard; never aborts).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
Marks the element null.
Marks the element null.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(inout) | :: | self |
the element (reset to the null state). |
Sets raw ns-since-midnight (interop; marks valid).
Sets the raw nanoseconds-since-midnight directly (interop/advanced accessor; marks the element valid); aborts on a value outside a day.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(inout) | :: | self |
receives the value (marked valid). |
||
| integer(kind=int64), | intent(in) | :: | nanoseconds |
nanoseconds since midnight, [0, 86400e9 - 1]. |
Raw ns-since-midnight; 0 for a null element (interop).
Returns the raw nanoseconds-since-midnight, or 0 for a null element (interop/advanced accessor; never aborts -- validity travels separately via is_null).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
ISO-8601 "HH:MM:SS[.fraction]" (aborts on null).
Writes the element as ISO-8601 "HH:MM:SS[.fraction]" (fraction omitted when zero, else the shortest of 3/6/9 digits that is exact); aborts on a null element. A subroutine for the same reason as parquet_date%to_string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element. |
||
| character(len=:), | intent(out), | allocatable | :: | str |
receives the formatted time. |
Sets from an ISO-8601 time string.
Sets the element from an ISO-8601 time string "HH:MM:SS[.fraction]" (1..9 fraction
digits). Failure handling matches parquet_date%parse: abort by default, or report via
the optional success (leaving the element null).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(out) | :: | self |
receives the parsed time (or null on caught failure). |
||
| character(len=*), | intent(in) | :: | str |
ISO-8601 time string. |
||
| logical, | intent(out), | optional | :: | success |
.true. on success; absent => abort on failure. |
Equality (aborts on a null operand).
Equality specific; see the operator(==) generic. Aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right operand. |
Inequality (aborts on a null operand).
Inequality specific; see the operator(/=) generic. Aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right operand. |
Ordering (aborts on a null operand).
Less-than specific; see the operator(<) generic. Aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right operand. |
Ordering (aborts on a null operand).
Less-or-equal specific; see the operator(<=) generic. Aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right operand. |
Ordering (aborts on a null operand).
Greater-than specific; see the operator(>) generic. Aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right operand. |
Ordering (aborts on a null operand).
Greater-or-equal specific; see the operator(>=) generic. Aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right operand. |
Difference or ns offset (wraps; aborts on a null operand or a >24h offset magnitude).
Difference specific; see the operator(-) generic. Nanoseconds, exact (bounded to +-1 day of ns since both operands lie in [0, 86400e9 - 1]); aborts on a null operand.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | a |
left (later) operand. |
||
| class(parquet_time), | intent(in) | :: | b |
right (earlier) operand. |
int32 specific of operator(-); see time_offset_ns_impl. The 24h magnitude guard is moot for this kind (int32's own range never reaches 86400e9 ns), kept only for symmetry with the int64 specific.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element to shift. |
||
| integer(kind=int32), | intent(in) | :: | n |
ns to subtract. |
self shifted back by n ns, wrapped.
int64 specific of operator(-); see time_offset_ns_impl. Aborts if abs(n) exceeds 24h of nanoseconds (checked on the raw, not-yet-negated input, so negating it afterwards can never overflow).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element to shift. |
||
| integer(kind=int64), | intent(in) | :: | n |
ns to subtract. |
self shifted back by n ns, wrapped.
Ns offset (wraps; aborts on a null operand or a >24h offset magnitude).
int32 specific of operator(+); see time_offset_ns_impl. The 24h magnitude guard is moot for this kind (int32's own range never reaches 86400e9 ns), kept only for symmetry with the int64 specific.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element to shift. |
||
| integer(kind=int32), | intent(in) | :: | n |
ns to add. |
self shifted forward by n ns, wrapped.
int64 specific of operator(+); see time_offset_ns_impl. Aborts if abs(n) exceeds 24h of nanoseconds.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_time), | intent(in) | :: | self |
the element to shift. |
||
| integer(kind=int64), | intent(in) | :: | n |
ns to add. |
self shifted forward by n ns, wrapped.
type :: parquet_time private integer(int64) :: nanoseconds = 0_int64 !! nanoseconds since midnight, [0, 86400e9 - 1]. logical :: valid = .false. !! .false. = null element (the default state). contains procedure :: set => time_set !! Sets from validated (hour, minute, second[, nanosecond]). procedure :: get => time_get !! Returns hour, minute, second[, nanosecond] (aborts on null). procedure :: hour => time_hour !! Hour 0..23 (aborts on null). procedure :: minute => time_minute !! Minute 0..59 (aborts on null). procedure :: second => time_second !! Second 0..59 (aborts on null). procedure :: nanosecond => time_nanosecond !! Sub-second part 0..999999999 (aborts on null). procedure :: is_null => time_is_null !! Whether the element is null (never aborts). procedure :: set_null => time_set_null !! Marks the element null. procedure :: set_raw => time_set_raw !! Sets raw ns-since-midnight (interop; marks valid). procedure :: raw => time_raw !! Raw ns-since-midnight; 0 for a null element (interop). procedure :: to_string => time_to_string !! ISO-8601 "HH:MM:SS[.fraction]" (aborts on null). procedure :: parse => time_parse !! Sets from an ISO-8601 time string. procedure, private :: time_eq !! == specific. procedure, private :: time_ne !! /= specific. procedure, private :: time_lt !! < specific. procedure, private :: time_le !! <= specific. procedure, private :: time_gt !! > specific. procedure, private :: time_ge !! >= specific. generic :: operator(==) => time_eq !! Equality (aborts on a null operand). generic :: operator(/=) => time_ne !! Inequality (aborts on a null operand). generic :: operator(<) => time_lt !! Ordering (aborts on a null operand). generic :: operator(<=) => time_le !! Ordering (aborts on a null operand). generic :: operator(>) => time_gt !! Ordering (aborts on a null operand). generic :: operator(>=) => time_ge !! Ordering (aborts on a null operand). procedure, private :: time_diff !! (time, time) specific of operator(-): ns difference. procedure, private :: time_sub_ns_i32 !! (time, integer(int32)) specific of operator(-). procedure, private :: time_sub_ns_i64 !! (time, integer(int64)) specific of operator(-). procedure, private :: time_add_ns_i32 !! (time, integer(int32)) specific of operator(+). procedure, private :: time_add_ns_i64 !! (time, integer(int64)) specific of operator(+). generic :: operator(-) => time_diff, time_sub_ns_i32, time_sub_ns_i64 !! Difference or ns offset (wraps; aborts on a null operand or a >24h offset magnitude). generic :: operator(+) => time_add_ns_i32, time_add_ns_i64 !! Ns offset (wraps; aborts on a null operand or a >24h offset magnitude). end type parquet_time