pub fn strftime<'a, V, F, E>(
format: F,
expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, E::Nullable, <F::Aggregate as AggregateKind>::Or<E::Aggregate>, (F::Sources, E::Sources)>where
V: SQLParam + 'a,
V::DialectMarker: DialectSupports<SQLiteDateTime>,
F: Expr<'a, V>,
F::SQLType: Textual,
E: Expr<'a, V>,
E::SQLType: Temporal,Expand description
Formats a time value as text (STRFTIME(format, expr)), on SQLite.
format must be text and expr temporal. The result is text and keeps
expr’s nullability. Common format codes:
%Yyear,%mmonth (01-12),%dday (01-31)%Hhour (00-23),%Mminute,%Ssecond%sUnix time,%wweekday (0-6, Sunday is 0),%jday of year
§Examples
let day = strftime("%Y-%m-%d", users.created_at);
assert_eq!(day.sql(), r#"STRFTIME (?, "users"."created_at")"#);