age

Function age 

Source
pub fn age<'a, V, E1, E2>(
    timestamp1: E1,
    timestamp2: E2,
) -> SQLExpr<'a, V, Text, <E1::Nullable as NullOr<E2::Nullable>>::Output, Scalar>
where V: SQLParam + 'a, E1: Expr<'a, V>, E1::SQLType: Temporal, E2: Expr<'a, V>, E2::SQLType: Temporal, E1::Nullable: NullOr<E2::Nullable>, E2::Nullable: Nullability,
Expand description

AGE - calculates the interval between two timestamps (PostgreSQL).

Returns Text (interval representation). The result is nullable if either input is nullable.

§Example

use drizzle_core::expr::age;

// SELECT AGE(NOW(), users.created_at)
let user_age = age(now(), users.created_at);