struct

Crysda::DateTimeCol

Inherits Crysda::DataCol / Struct / Value / Object

=========================================================================== DateTime Column - stores Time values with optimized internal storage

Constants

DATETIME_FORMATS = ["%Y-%m-%d %H:%M:%S", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%dT%H:%M:%SZ", "%Y-%m-%d %H:%M", "%Y-%m-%d", "%d/%m/%Y %H:%M:%S", "%d/%m/%Y", "%m/%d/%Y %H:%M:%S", "%m/%d/%Y", "%Y%m%d"]

Second-level date/time formats for parsing

DATETIME_MS_FORMATS = ["%Y-%m-%d %H:%M:%S.%L", "%Y-%m-%dT%H:%M:%S.%L", "%Y-%m-%dT%H:%M:%S.%LZ", "%d/%m/%Y %H:%M:%S.%L", "%m/%d/%Y %H:%M:%S.%L"]

Millisecond-level formats (extends DATETIME_FORMATS with %L)

Constructors

from_epoch(name : String, epochs : Array(Int64 | Nil)) : DateTimeCol

Create from array of epoch seconds (converts to milliseconds internally)

Source
from_epoch_ms(name : String, epochs : Array(Int64 | Nil)) : DateTimeCol

Create from array of epoch milliseconds

Source
new(name : String, val : Array(Time | Nil))
Source
parse(name : String, strings : Array(String | Nil), format : String | Nil = nil) : DateTimeCol

Parse strings to DateTime using common formats

Source

Instance methods

<(val : Time)
Source
<=(val : Time)
Source
==(val : Time)
Source
>(val : Time)
Source
>=(val : Time)
Source
compare(left : Int32, right : Int32, null_last = true) : Int32
Source
day

Extract day component (1-31)

Source
day_of_week

Extract day of week (0=Sunday, 6=Saturday)

Source
day_of_year

Extract day of year (1-366)

Source
each

Lazy iteration

Source
each_non_null
Source
each_with_index
Source
has_nulls?
Source
hour

Extract hour component (0-23)

Source
max(remove_na = false) : Time

Get max datetime

Source
millisecond

Extract millisecond component (0-999)

Source
min(remove_na = false) : Time

Get min datetime

Source
minute

Extract minute component (0-59)

Source
month

Extract month component (1-12)

Source
second

Extract second component (0-59)

Source
strftime(format : String) : StringCol

Format as strings

Source
to_timestamp(name : String = @name) : TimestampCol
Source
unsafe_fetch(index : Int32) : Time | Nil
Source
values
Source
year

Extract year component

Source