Timestamp#

class rbc.heavydb.Timestamp(time)#

RBC Timestamp type that corresponds to HeavyDB type TIMESTAMP.

struct Timestamp {
    int64_t time;
};
from rbc.heavydb import Timestamp
@heavydb('int32_t(Column<Timestamp>, RowMultiplier, Column<int64_t>')
def get_years(column_times, m, column_hours):
    for i in range(len(column_times)):
        column_hours[i] = column_times[i].getHours()
    return len(column_times)

All comparison (dunder methods) are implemented for this class.

Methods

Timestamp.__init__(time)

Timestamp.getDay()

Get time as day

Timestamp.getHours()

Get time as hours

Timestamp.getMicroseconds()

Get time as microseconds

Timestamp.getMilliseconds()

Get time as milliseconds

Timestamp.getMinutes()

Get time as minutes

Timestamp.getMonth()

Get time as month

Timestamp.getSeconds()

Get time as seconds

Timestamp.getYear()

Get time as year

Timestamp.truncateToDay()

Return a new Timestamp with time truncated to day

Timestamp.truncateToHours()

Return a new Timestamp with time truncated to hours

Timestamp.truncateToMicroseconds()

Return a new Timestamp with time truncated to microseconds

Timestamp.truncateToMilliseconds()

Return a new Timestamp with time truncated to milliseconds

Timestamp.truncateToMinutes()

Return a new Timestamp with time truncated to minutes

Timestamp.truncateToMonth()

Return a new Timestamp with time truncated to month

Timestamp.truncateToSeconds()

Return a new Timestamp with time truncated to seconds

Timestamp.truncateToYear()

Return a new Timestamp with time truncated to year

Parameters:

time (int | nb_types.StringLiteral) –

Return type:

Timestamp