Trait polars::prelude::TemporalMethods
source · [−]pub trait TemporalMethods: SeriesTrait {
fn hour(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn minute(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn second(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn nanosecond(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn weekday(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn week(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn ordinal_day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn month(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError> { ... }
fn strftime(&self, fmt: &str) -> Result<Series, PolarsError> { ... }
fn timestamp(
&self,
tu: TimeUnit
) -> Result<ChunkedArray<Int64Type>, PolarsError> { ... }
}
Provided methods
fn hour(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn hour(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
fn minute(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn minute(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
fn second(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn second(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
fn nanosecond(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn nanosecond(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
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.
fn day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
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.)
fn weekday(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn weekday(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Returns the weekday number where monday = 0 and sunday = 6
fn week(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn week(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
fn ordinal_day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn ordinal_day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
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 month(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn month(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>
fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>
Extract month from underlying NaiveDateTime representation. Returns the year number in the calendar date.
Format Date/Datetimewith a fmt
rule. See chrono strftime/strptime.
fn timestamp(
&self,
tu: TimeUnit
) -> Result<ChunkedArray<Int64Type>, PolarsError>
fn timestamp(
&self,
tu: TimeUnit
) -> Result<ChunkedArray<Int64Type>, PolarsError>
Convert date(time) object to timestamp in TimeUnit
.