Struct polars_lazy::dsl::dt::DateLikeNameSpace

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

Specialized expressions for Series with dates/datetimes.

Implementations§

§

impl DateLikeNameSpace

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.

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

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

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.

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

Change the underlying TimeUnit. And update the data accordingly.

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

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

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

Available on crate feature timezones only.

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

pub fn millennium(self) -> Expr

Get the millennium of a Date/Datetime

pub fn century(self) -> Expr

Get the century of a Date/Datetime

pub fn year(self) -> Expr

Get the year of a Date/Datetime

pub fn is_leap_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.

pub fn month(self) -> Expr

Get the month of a Date/Datetime.

pub fn quarter(self) -> Expr

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

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

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

pub fn day(self) -> Expr

Get the month of a Date/Datetime.

pub fn ordinal_day(self) -> Expr

Get the ordinal_day of a Date/Datetime.

pub fn time(self) -> Expr

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

pub fn date(self) -> Expr

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

pub fn datetime(self) -> Expr

Get the (local) datetime of a Datetime.

pub fn hour(self) -> Expr

Get the hour of a Datetime/Time64.

pub fn minute(self) -> Expr

Get the minute of a Datetime/Time64.

pub fn second(self) -> Expr

Get the second of a Datetime/Time64.

pub fn millisecond(self) -> Expr

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

pub fn microsecond(self) -> Expr

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

pub fn nanosecond(self) -> Expr

Get the nanosecond part of a Time64.

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

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

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

Truncate the Datetime/Date range into buckets.

pub fn month_start(self) -> Expr

Available on crate feature date_offset only.

Roll backward to the first day of the month.

pub fn month_end(self) -> Expr

Available on crate feature date_offset only.

Roll forward to the last day of the month.

pub fn base_utc_offset(self) -> Expr

Available on crate feature timezones only.

Get the base offset from UTC.

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

pub fn round<S>(self, every: Expr, offset: S) -> Expr
where S: AsRef<str>,

Round the Datetime/Date range into buckets.

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

Available on crate feature 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<String>, ambiguous: Expr, non_existent: NonExistent ) -> Expr

Available on crate feature timezones only.

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

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

pub fn total_days(self) -> Expr

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

pub fn total_hours(self) -> Expr

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

pub fn total_minutes(self) -> Expr

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

pub fn total_seconds(self) -> Expr

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

pub fn total_milliseconds(self) -> Expr

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

pub fn total_microseconds(self) -> Expr

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

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

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

§

fn vzip(self) -> V

§

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