Skip to main content

current_timestamp

Function current_timestamp 

Source
pub fn current_timestamp<'a, V>() -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::TimestampTz, NonNull, Scalar, ()>
where V: SQLParam + 'a,
Expand description

The current date and time (CURRENT_TIMESTAMP), on every dialect.

The result is the dialect’s timestamp-with-time-zone type (text on SQLite, timestamptz on PostgreSQL, TIMESTAMP on MySQL) and never NULL.

§Examples

assert_eq!(current_timestamp::<Value>().sql(), "CURRENT_TIMESTAMP");