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.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 truncate(self, every: Expr, offset: String) -> Expr
pub fn truncate(self, every: Expr, offset: String) -> Expr
Truncate the Datetime/Date range into buckets.
sourcepub fn month_start(self) -> Expr
Available on crate feature date_offset
only.
pub fn month_start(self) -> Expr
date_offset
only.Roll backward to the first day of the month.
sourcepub fn month_end(self) -> Expr
Available on crate feature date_offset
only.
pub fn month_end(self) -> Expr
date_offset
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 round<S: AsRef<str>>(self, every: S, offset: S) -> Expr
pub fn round<S: AsRef<str>>(self, every: S, offset: S) -> Expr
Round the Datetime/Date range into buckets.
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, 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.