Skip to main content

to_timestamp

Function to_timestamp 

Source
pub fn to_timestamp<'a, V, E>(
    expr: E,
) -> SQLExpr<'a, V, Timestamptz, E::Nullable, E::Aggregate>
Expand description

TO_TIMESTAMP - converts a Unix timestamp to a timestamp (PostgreSQL).

Returns TimestampTz type. The input should be a numeric Unix timestamp.

ยงExample

use drizzle_core::expr::to_timestamp;

// SELECT TO_TIMESTAMP(users.created_unix)
let ts = to_timestamp(users.created_unix);