struct

DuckDB::Timestamp

Inherits Struct / Value / Object

Constructors

new(date : DuckDB::Date, time_of_day : DuckDB::TimeOfDay)
Source
new(time : Time)

Initializes a timestamp with a Time instance in UTC.

It raises ArgumentError if time is not in UTC. NOTE: Beware the loss of precision in the fractional part (nanoseconds to microseconds)

Source
new(string : String)
Source
new(microseconds : Int64)

Initialize with microseconds since Time::UNIX_EPOCH

Source

Instance methods

==(other : self) : Bool
Source
date
Source
day(*args, **options)
Source
day(*args, **options, &)
Source
hour(*args, **options)
Source
hour(*args, **options, &)
Source
microsecond(*args, **options)
Source
microsecond(*args, **options, &)
Source
millisecond(*args, **options)
Source
millisecond(*args, **options, &)
Source
minute(*args, **options)
Source
minute(*args, **options, &)
Source
month(*args, **options)
Source
month(*args, **options, &)
Source
second(*args, **options)
Source
second(*args, **options, &)
Source
submillisecond?(*args, **options)
Source
submillisecond?(*args, **options, &)
Source
subsecond?(*args, **options)
Source
subsecond?(*args, **options, &)
Source
time_of_day
Source
to_s

Returns the timestamp with an ISO 8601 format.

Source
to_time

Returns a Time instance with the respective timestamp in UTC.

Source
year(*args, **options)
Source
year(*args, **options, &)
Source