pub trait DatetimeMethods: AsDatetime {
Show 15 methods
// Provided methods
fn year(&self) -> ChunkedArray<Int32Type> { ... }
fn is_leap_year(&self) -> ChunkedArray<BooleanType> { ... }
fn iso_year(&self) -> ChunkedArray<Int32Type> { ... }
fn quarter(&self) -> ChunkedArray<Int8Type> { ... }
fn month(&self) -> ChunkedArray<Int8Type> { ... }
fn weekday(&self) -> ChunkedArray<Int8Type> { ... }
fn week(&self) -> ChunkedArray<Int8Type> { ... }
fn day(&self) -> ChunkedArray<Int8Type> { ... }
fn hour(&self) -> ChunkedArray<Int8Type> { ... }
fn minute(&self) -> ChunkedArray<Int8Type> { ... }
fn second(&self) -> ChunkedArray<Int8Type> { ... }
fn nanosecond(&self) -> ChunkedArray<Int32Type> { ... }
fn ordinal(&self) -> ChunkedArray<Int16Type> { ... }
fn parse_from_str_slice(
name: PlSmallStr,
v: &[&str],
fmt: &str,
tu: TimeUnit,
) -> Logical<DatetimeType, Int64Type> { ... }
fn new_from_parts(
year: &ChunkedArray<Int32Type>,
month: &ChunkedArray<Int8Type>,
day: &ChunkedArray<Int8Type>,
hour: &ChunkedArray<Int8Type>,
minute: &ChunkedArray<Int8Type>,
second: &ChunkedArray<Int8Type>,
nanosecond: &ChunkedArray<Int32Type>,
ambiguous: &ChunkedArray<StringType>,
time_unit: &TimeUnit,
time_zone: Option<&str>,
name: PlSmallStr,
) -> Result<Logical<DatetimeType, Int64Type>, PolarsError> { ... }
}
temporal
only.Provided Methods§
Sourcefn year(&self) -> ChunkedArray<Int32Type>
fn year(&self) -> ChunkedArray<Int32Type>
Extract month from underlying NaiveDateTime representation. Returns the year number in the calendar date.
Sourcefn is_leap_year(&self) -> ChunkedArray<BooleanType>
fn is_leap_year(&self) -> ChunkedArray<BooleanType>
Extract year from underlying NaiveDate representation. Returns whether the year is a leap year.
fn iso_year(&self) -> ChunkedArray<Int32Type>
Sourcefn quarter(&self) -> ChunkedArray<Int8Type>
fn quarter(&self) -> ChunkedArray<Int8Type>
Extract quarter from underlying NaiveDateTime representation. Quarters range from 1 to 4.
Sourcefn month(&self) -> ChunkedArray<Int8Type>
fn month(&self) -> ChunkedArray<Int8Type>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
Sourcefn weekday(&self) -> ChunkedArray<Int8Type>
fn weekday(&self) -> ChunkedArray<Int8Type>
Extract ISO weekday from underlying NaiveDateTime representation. Returns the weekday number where monday = 1 and sunday = 7
Sourcefn week(&self) -> ChunkedArray<Int8Type>
fn week(&self) -> ChunkedArray<Int8Type>
Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
Sourcefn day(&self) -> ChunkedArray<Int8Type>
fn day(&self) -> ChunkedArray<Int8Type>
Extract day from underlying NaiveDateTime representation. Returns the day of month starting from 1.
The return value ranges from 1 to 31. (The last day of month differs by months.)
Sourcefn hour(&self) -> ChunkedArray<Int8Type>
fn hour(&self) -> ChunkedArray<Int8Type>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
Sourcefn minute(&self) -> ChunkedArray<Int8Type>
fn minute(&self) -> ChunkedArray<Int8Type>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
Sourcefn second(&self) -> ChunkedArray<Int8Type>
fn second(&self) -> ChunkedArray<Int8Type>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
Sourcefn nanosecond(&self) -> ChunkedArray<Int32Type>
fn nanosecond(&self) -> ChunkedArray<Int32Type>
Extract second from underlying NaiveDateTime representation. Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second.
Sourcefn ordinal(&self) -> ChunkedArray<Int16Type>
fn ordinal(&self) -> ChunkedArray<Int16Type>
Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
fn parse_from_str_slice( name: PlSmallStr, v: &[&str], fmt: &str, tu: TimeUnit, ) -> Logical<DatetimeType, Int64Type>
Sourcefn new_from_parts(
year: &ChunkedArray<Int32Type>,
month: &ChunkedArray<Int8Type>,
day: &ChunkedArray<Int8Type>,
hour: &ChunkedArray<Int8Type>,
minute: &ChunkedArray<Int8Type>,
second: &ChunkedArray<Int8Type>,
nanosecond: &ChunkedArray<Int32Type>,
ambiguous: &ChunkedArray<StringType>,
time_unit: &TimeUnit,
time_zone: Option<&str>,
name: PlSmallStr,
) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>
fn new_from_parts( year: &ChunkedArray<Int32Type>, month: &ChunkedArray<Int8Type>, day: &ChunkedArray<Int8Type>, hour: &ChunkedArray<Int8Type>, minute: &ChunkedArray<Int8Type>, second: &ChunkedArray<Int8Type>, nanosecond: &ChunkedArray<Int32Type>, ambiguous: &ChunkedArray<StringType>, time_unit: &TimeUnit, time_zone: Option<&str>, name: PlSmallStr, ) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>
Construct a datetime ChunkedArray from individual time components.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.