Struct polars_plan::dsl::dt::DateLikeNameSpace

source ·
pub struct DateLikeNameSpace(/* private fields */);
Available on crate feature temporal only.
Expand description

Specialized expressions for Series with dates/datetimes.

Implementations§

source§

impl DateLikeNameSpace

source

pub fn add_business_days( self, n: Expr, week_mask: [bool; 7], holidays: Vec<i32>, roll: Roll, ) -> Expr

Available on crate feature business only.

Add a given number of business days.

source

pub fn to_string(self, format: &str) -> Expr

Convert from Date/Time/Datetime into String with the given format. See chrono strftime/strptime.

source

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.

source

pub fn cast_time_unit(self, tu: TimeUnit) -> Expr

Change the underlying TimeUnit. And update the data accordingly.

source

pub fn with_time_unit(self, tu: TimeUnit) -> Expr

Change the underlying TimeUnit of the Series. This does not modify the data.

source

pub fn convert_time_zone(self, time_zone: TimeZone) -> Expr

Available on crate feature timezones only.

Change the underlying TimeZone of the Series. This does not modify the data.

source

pub fn millennium(self) -> Expr

Get the millennium of a Date/Datetime

source

pub fn century(self) -> Expr

Get the century of a Date/Datetime

source

pub fn year(self) -> Expr

Get the year of a Date/Datetime

source

pub fn is_leap_year(self) -> Expr

source

pub fn iso_year(self) -> Expr

Get the iso-year of a Date/Datetime. This may not correspond with a calendar year.

source

pub fn month(self) -> Expr

Get the month of a Date/Datetime.

source

pub fn quarter(self) -> Expr

Extract quarter from underlying NaiveDateTime representation. Quarters range from 1 to 4.

source

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.)

source

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

source

pub fn day(self) -> Expr

Get the month of a Date/Datetime.

source

pub fn ordinal_day(self) -> Expr

Get the ordinal_day of a Date/Datetime.

source

pub fn time(self) -> Expr

Get the (local) time of a Date/Datetime/Time.

source

pub fn date(self) -> Expr

Get the (local) date of a Date/Datetime.

source

pub fn datetime(self) -> Expr

Get the (local) datetime of a Datetime.

source

pub fn hour(self) -> Expr

Get the hour of a Datetime/Time64.

source

pub fn minute(self) -> Expr

Get the minute of a Datetime/Time64.

source

pub fn second(self) -> Expr

Get the second of a Datetime/Time64.

source

pub fn millisecond(self) -> Expr

Get the millisecond of a Time64 (scaled from nanosecs).

source

pub fn microsecond(self) -> Expr

Get the microsecond of a Time64 (scaled from nanosecs).

source

pub fn nanosecond(self) -> Expr

Get the nanosecond part of a Time64.

source

pub fn timestamp(self, tu: TimeUnit) -> Expr

Return the timestamp (UNIX epoch) of a Datetime/Date.

source

pub fn truncate(self, every: Expr) -> Expr

Truncate the Datetime/Date range into buckets.

source

pub fn month_start(self) -> Expr

Available on crate feature month_start only.

Roll backward to the first day of the month.

source

pub fn month_end(self) -> Expr

Available on crate feature month_end only.

Roll forward to the last day of the month.

source

pub fn base_utc_offset(self) -> Expr

Available on crate feature timezones only.

Get the base offset from UTC.

source

pub fn dst_offset(self) -> Expr

Available on crate feature timezones only.

Get the additional offset from UTC currently in effect (usually due to daylight saving time).

source

pub fn round(self, every: Expr) -> Expr

Round the Datetime/Date range into buckets.

source

pub fn offset_by(self, by: Expr) -> Expr

Available on crate feature offset_by only.

Offset this Date/Datetime by a given offset Duration. This will take leap years/ months into account.

source

pub fn replace_time_zone( self, time_zone: Option<TimeZone>, ambiguous: Expr, non_existent: NonExistent, ) -> Expr

Available on crate feature timezones only.
source

pub fn combine(self, time: Expr, tu: TimeUnit) -> Expr

Combine an existing Date/Datetime with a Time, creating a new Datetime value.

source

pub fn total_days(self) -> Expr

Express a Duration in terms of its total number of integer days.

source

pub fn total_hours(self) -> Expr

Express a Duration in terms of its total number of integer hours.

source

pub fn total_minutes(self) -> Expr

Express a Duration in terms of its total number of integer minutes.

source

pub fn total_seconds(self) -> Expr

Express a Duration in terms of its total number of integer seconds.

source

pub fn total_milliseconds(self) -> Expr

Express a Duration in terms of its total number of milliseconds.

source

pub fn total_microseconds(self) -> Expr

Express a Duration in terms of its total number of microseconds.

source

pub fn total_nanoseconds(self) -> Expr

Express a Duration in terms of its total number of nanoseconds.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> Ungil for T
where T: Send,