Skip to content

strftime

Source code

Description

Format Date/Datetime with a formatting rule. See chrono strftime/strptime <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>_.

Usage

<Expr>$dt$strftime(format)

Arguments

format string format very much like in R passed to chrono

Value

Date/Datetime expr

Examples

library(polars)

pl$lit(as.POSIXct("2021-01-02 12:13:14", tz = "GMT"))$dt$strftime("this is the year: %Y")$to_r()
#> [1] "this is the year: 2021"