Struct polars_plan::dsl::dt::DateLikeNameSpace
source · pub struct DateLikeNameSpace(/* private fields */);
temporal
only.Expand description
Specialized expressions for Series
with dates/datetimes.
Implementations§
source§impl DateLikeNameSpace
impl DateLikeNameSpace
sourcepub fn to_string(self, format: &str) -> Expr
pub fn to_string(self, format: &str) -> Expr
Convert from Date/Time/Datetime into String with the given format. See chrono strftime/strptime.
sourcepub fn strftime(self, format: &str) -> Expr
pub fn strftime(self, format: &str) -> Expr
Convert from Date/Time/Datetime into String with the given format. See chrono strftime/strptime.
Alias for to_string
.
sourcepub fn cast_time_unit(self, tu: TimeUnit) -> Expr
pub fn cast_time_unit(self, tu: TimeUnit) -> Expr
Change the underlying TimeUnit
. And update the data accordingly.
sourcepub fn with_time_unit(self, tu: TimeUnit) -> Expr
pub fn with_time_unit(self, tu: TimeUnit) -> Expr
sourcepub fn convert_time_zone(self, time_zone: TimeZone) -> Expr
Available on crate feature timezones
only.
pub fn convert_time_zone(self, time_zone: TimeZone) -> Expr
timezones
only.pub fn is_leap_year(self) -> Expr
sourcepub fn iso_year(self) -> Expr
pub fn iso_year(self) -> Expr
Get the iso-year of a Date/Datetime. This may not correspond with a calendar year.
sourcepub fn quarter(self) -> Expr
pub fn quarter(self) -> Expr
Extract quarter from underlying NaiveDateTime representation. Quarters range from 1 to 4.
sourcepub fn week(self) -> Expr
pub fn week(self) -> Expr
Extract the week from the underlying Date representation. Can be performed on Date and Datetime Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
sourcepub fn weekday(self) -> Expr
pub fn weekday(self) -> Expr
Extract the ISO week day from the underlying Date representation. Can be performed on Date and Datetime. Returns the weekday number where monday = 1 and sunday = 7
sourcepub fn ordinal_day(self) -> Expr
pub fn ordinal_day(self) -> Expr
Get the ordinal_day of a Date/Datetime
sourcepub fn millisecond(self) -> Expr
pub fn millisecond(self) -> Expr
Get the millisecond of a Time64 (scaled from nanosecs)
sourcepub fn microsecond(self) -> Expr
pub fn microsecond(self) -> Expr
Get the microsecond of a Time64 (scaled from nanosecs)
sourcepub fn nanosecond(self) -> Expr
pub fn nanosecond(self) -> Expr
Get the nanosecond part of a Time64
pub fn timestamp(self, tu: TimeUnit) -> Expr
pub fn truncate(self, every: Expr, offset: String) -> Expr
pub fn month_start(self) -> Expr
date_offset
only.pub fn month_end(self) -> Expr
date_offset
only.pub fn base_utc_offset(self) -> Expr
timezones
only.pub fn dst_offset(self) -> Expr
timezones
only.pub fn round<S: AsRef<str>>(self, every: S, offset: S) -> Expr
sourcepub fn offset_by(self, by: Expr) -> Expr
Available on crate feature date_offset
only.
pub fn offset_by(self, by: Expr) -> Expr
date_offset
only.Offset this Date/Datetime
by a given offset Duration
.
This will take leap years/ months into account.
pub fn replace_time_zone( self, time_zone: Option<TimeZone>, ambiguous: Expr ) -> Expr
timezones
only.