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 add_business_days(
self,
n: Expr,
week_mask: [bool; 7],
holidays: Vec<i32>,
roll: Roll,
) -> Expr
Available on crate feature business
only.
pub fn add_business_days( self, n: Expr, week_mask: [bool; 7], holidays: Vec<i32>, roll: Roll, ) -> Expr
business
only.Add a given number of business days.
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.sourcepub fn millennium(self) -> Expr
pub fn millennium(self) -> Expr
Get the millennium of a Date/Datetime
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.
sourcepub fn timestamp(self, tu: TimeUnit) -> Expr
pub fn timestamp(self, tu: TimeUnit) -> Expr
Return the timestamp (UNIX epoch) of a Datetime/Date.
sourcepub fn month_start(self) -> Expr
Available on crate feature month_start
only.
pub fn month_start(self) -> Expr
month_start
only.Roll backward to the first day of the month.
sourcepub fn month_end(self) -> Expr
Available on crate feature month_end
only.
pub fn month_end(self) -> Expr
month_end
only.Roll forward to the last day of the month.
sourcepub fn base_utc_offset(self) -> Expr
Available on crate feature timezones
only.
pub fn base_utc_offset(self) -> Expr
timezones
only.Get the base offset from UTC.
sourcepub fn dst_offset(self) -> Expr
Available on crate feature timezones
only.
pub fn dst_offset(self) -> Expr
timezones
only.Get the additional offset from UTC currently in effect (usually due to daylight saving time).
sourcepub fn offset_by(self, by: Expr) -> Expr
Available on crate feature offset_by
only.
pub fn offset_by(self, by: Expr) -> Expr
offset_by
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, non_existent: NonExistent, ) -> Expr
timezones
only.sourcepub fn combine(self, time: Expr, tu: TimeUnit) -> Expr
pub fn combine(self, time: Expr, tu: TimeUnit) -> Expr
Combine an existing Date/Datetime with a Time, creating a new Datetime value.
sourcepub fn total_days(self) -> Expr
pub fn total_days(self) -> Expr
Express a Duration in terms of its total number of integer days.
sourcepub fn total_hours(self) -> Expr
pub fn total_hours(self) -> Expr
Express a Duration in terms of its total number of integer hours.
sourcepub fn total_minutes(self) -> Expr
pub fn total_minutes(self) -> Expr
Express a Duration in terms of its total number of integer minutes.
sourcepub fn total_seconds(self) -> Expr
pub fn total_seconds(self) -> Expr
Express a Duration in terms of its total number of integer seconds.
sourcepub fn total_milliseconds(self) -> Expr
pub fn total_milliseconds(self) -> Expr
Express a Duration in terms of its total number of milliseconds.
sourcepub fn total_microseconds(self) -> Expr
pub fn total_microseconds(self) -> Expr
Express a Duration in terms of its total number of microseconds.
sourcepub fn total_nanoseconds(self) -> Expr
pub fn total_nanoseconds(self) -> Expr
Express a Duration in terms of its total number of nanoseconds.
Auto Trait Implementations§
impl Freeze for DateLikeNameSpace
impl !RefUnwindSafe for DateLikeNameSpace
impl Send for DateLikeNameSpace
impl Sync for DateLikeNameSpace
impl Unpin for DateLikeNameSpace
impl !UnwindSafe for DateLikeNameSpace
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more