Trait polars_time::series::TemporalMethods
source · pub trait TemporalMethods: AsSeries {
Show 15 methods
fn hour(&self) -> PolarsResult<UInt32Chunked> { ... }
fn minute(&self) -> PolarsResult<UInt32Chunked> { ... }
fn second(&self) -> PolarsResult<UInt32Chunked> { ... }
fn nanosecond(&self) -> PolarsResult<UInt32Chunked> { ... }
fn day(&self) -> PolarsResult<UInt32Chunked> { ... }
fn weekday(&self) -> PolarsResult<UInt32Chunked> { ... }
fn week(&self) -> PolarsResult<UInt32Chunked> { ... }
fn ordinal_day(&self) -> PolarsResult<UInt32Chunked> { ... }
fn year(&self) -> PolarsResult<Int32Chunked> { ... }
fn iso_year(&self) -> PolarsResult<Int32Chunked> { ... }
fn ordinal_year(&self) -> PolarsResult<Int32Chunked> { ... }
fn quarter(&self) -> PolarsResult<UInt32Chunked> { ... }
fn month(&self) -> PolarsResult<UInt32Chunked> { ... }
fn strftime(&self, fmt: &str) -> PolarsResult<Series> { ... }
fn timestamp(&self, tu: TimeUnit) -> PolarsResult<Int64Chunked> { ... }
}
Provided Methods§
sourcefn hour(&self) -> PolarsResult<UInt32Chunked>
fn hour(&self) -> PolarsResult<UInt32Chunked>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
sourcefn minute(&self) -> PolarsResult<UInt32Chunked>
fn minute(&self) -> PolarsResult<UInt32Chunked>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
sourcefn second(&self) -> PolarsResult<UInt32Chunked>
fn second(&self) -> PolarsResult<UInt32Chunked>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
sourcefn nanosecond(&self) -> PolarsResult<UInt32Chunked>
fn nanosecond(&self) -> PolarsResult<UInt32Chunked>
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 day(&self) -> PolarsResult<UInt32Chunked>
fn day(&self) -> PolarsResult<UInt32Chunked>
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 weekday(&self) -> PolarsResult<UInt32Chunked>
fn weekday(&self) -> PolarsResult<UInt32Chunked>
Returns the weekday number where monday = 0 and sunday = 6
sourcefn week(&self) -> PolarsResult<UInt32Chunked>
fn week(&self) -> PolarsResult<UInt32Chunked>
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 ordinal_day(&self) -> PolarsResult<UInt32Chunked>
fn ordinal_day(&self) -> PolarsResult<UInt32Chunked>
Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
sourcefn year(&self) -> PolarsResult<Int32Chunked>
fn year(&self) -> PolarsResult<Int32Chunked>
Extract year from underlying NaiveDateTime representation. Returns the year number in the calendar date.
fn iso_year(&self) -> PolarsResult<Int32Chunked>
sourcefn ordinal_year(&self) -> PolarsResult<Int32Chunked>
fn ordinal_year(&self) -> PolarsResult<Int32Chunked>
Extract ordinal year from underlying NaiveDateTime representation. Returns the year number in the calendar date.
sourcefn quarter(&self) -> PolarsResult<UInt32Chunked>
fn quarter(&self) -> PolarsResult<UInt32Chunked>
Extract quarter from underlying NaiveDateTime representation. Quarters range from 1 to 4.
sourcefn month(&self) -> PolarsResult<UInt32Chunked>
fn month(&self) -> PolarsResult<UInt32Chunked>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
sourcefn strftime(&self, fmt: &str) -> PolarsResult<Series>
fn strftime(&self, fmt: &str) -> PolarsResult<Series>
Format Date/Datetimewith a fmt
rule. See chrono strftime/strptime.
sourcefn timestamp(&self, tu: TimeUnit) -> PolarsResult<Int64Chunked>
fn timestamp(&self, tu: TimeUnit) -> PolarsResult<Int64Chunked>
dtype-date
and dtype-datetime
only.Convert date(time) object to timestamp in TimeUnit
.