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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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