pub struct DatetimeAccessor<'a> { /* private fields */ }Implementations§
Source§impl DatetimeAccessor<'_>
impl DatetimeAccessor<'_>
Sourcepub fn year(&self) -> Result<Series, FrameError>
pub fn year(&self) -> Result<Series, FrameError>
Extract year component.
Matches pd.Series.dt.year.
Sourcepub fn month(&self) -> Result<Series, FrameError>
pub fn month(&self) -> Result<Series, FrameError>
Extract month component (1-12).
Matches pd.Series.dt.month.
Sourcepub fn day(&self) -> Result<Series, FrameError>
pub fn day(&self) -> Result<Series, FrameError>
Extract day component (1-31).
Matches pd.Series.dt.day.
Sourcepub fn hour(&self) -> Result<Series, FrameError>
pub fn hour(&self) -> Result<Series, FrameError>
Extract hour component (0-23).
Matches pd.Series.dt.hour.
Sourcepub fn minute(&self) -> Result<Series, FrameError>
pub fn minute(&self) -> Result<Series, FrameError>
Extract minute component (0-59).
Matches pd.Series.dt.minute.
Sourcepub fn second(&self) -> Result<Series, FrameError>
pub fn second(&self) -> Result<Series, FrameError>
Extract second component (0-59).
Matches pd.Series.dt.second.
Sourcepub fn microsecond(&self) -> Result<Series, FrameError>
pub fn microsecond(&self) -> Result<Series, FrameError>
Extract microsecond component (0-999999).
Matches pd.Series.dt.microsecond.
Sourcepub fn nanosecond(&self) -> Result<Series, FrameError>
pub fn nanosecond(&self) -> Result<Series, FrameError>
Extract nanosecond component (0-999).
Matches pd.Series.dt.nanosecond.
Sourcepub fn dayofweek(&self) -> Result<Series, FrameError>
pub fn dayofweek(&self) -> Result<Series, FrameError>
Extract day of week (Monday=0, Sunday=6).
Matches pd.Series.dt.dayofweek / pd.Series.dt.weekday.
Sourcepub fn weekday(&self) -> Result<Series, FrameError>
pub fn weekday(&self) -> Result<Series, FrameError>
Alias for dayofweek(). Matches pd.Series.dt.weekday.
Sourcepub fn day_of_week(&self) -> Result<Series, FrameError>
pub fn day_of_week(&self) -> Result<Series, FrameError>
Alias for dayofweek(). Matches pd.Series.dt.day_of_week.
Sourcepub fn date(&self) -> Result<Series, FrameError>
pub fn date(&self) -> Result<Series, FrameError>
Extract date part as string (YYYY-MM-DD).
Matches pd.Series.dt.date.
Sourcepub fn time(&self) -> Result<Series, FrameError>
pub fn time(&self) -> Result<Series, FrameError>
Extract time part as string (HH:MM:SS).
Matches pd.Series.dt.time.
Sourcepub fn tz(&self) -> Result<Series, FrameError>
pub fn tz(&self) -> Result<Series, FrameError>
Extract timezone info from datetime strings.
Returns the timezone suffix (e.g., “+00:00”, “Z”, “-05:00”) or None for naive (timezone-unaware) datetimes.
Matches pd.Series.dt.tz inspection pattern.
Sourcepub fn timetz(&self) -> Result<Series, FrameError>
pub fn timetz(&self) -> Result<Series, FrameError>
Extract time with timezone info preserved (HH:MM:SS+TZ).
Matches pd.Series.dt.timetz which returns time objects with tzinfo.
For naive datetimes, returns time without timezone suffix.
Sourcepub fn components(&self) -> Result<DataFrame, FrameError>
pub fn components(&self) -> Result<DataFrame, FrameError>
Returns DataFrame with datetime components (year, month, day, hour, minute, second).
Similar to pd.Series.dt.components for Timedelta, but for datetime values.
Sourcepub fn quarter(&self) -> Result<Series, FrameError>
pub fn quarter(&self) -> Result<Series, FrameError>
Extract quarter (1-4).
Matches pd.Series.dt.quarter.
Sourcepub fn dayofyear(&self) -> Result<Series, FrameError>
pub fn dayofyear(&self) -> Result<Series, FrameError>
Extract day of year (1-366).
Matches pd.Series.dt.dayofyear.
Sourcepub fn day_of_year(&self) -> Result<Series, FrameError>
pub fn day_of_year(&self) -> Result<Series, FrameError>
Alias for dayofyear(). Matches pd.Series.dt.day_of_year.
Sourcepub fn weekofyear(&self) -> Result<Series, FrameError>
pub fn weekofyear(&self) -> Result<Series, FrameError>
Extract ISO week number (1-53).
Matches pd.Series.dt.isocalendar().week.
Sourcepub fn week(&self) -> Result<Series, FrameError>
pub fn week(&self) -> Result<Series, FrameError>
Alias for weekofyear(). Matches pd.Series.dt.week.
Sourcepub fn isocalendar(&self) -> Result<DataFrame, FrameError>
pub fn isocalendar(&self) -> Result<DataFrame, FrameError>
Returns a DataFrame with ISO calendar columns: year, week, day.
Matches pd.Series.dt.isocalendar().
Sourcepub fn is_month_start(&self) -> Result<Series, FrameError>
pub fn is_month_start(&self) -> Result<Series, FrameError>
Check if date is the first day of the month.
Matches pd.Series.dt.is_month_start.
Sourcepub fn is_month_end(&self) -> Result<Series, FrameError>
pub fn is_month_end(&self) -> Result<Series, FrameError>
Check if date is the last day of the month.
Matches pd.Series.dt.is_month_end.
Sourcepub fn is_quarter_start(&self) -> Result<Series, FrameError>
pub fn is_quarter_start(&self) -> Result<Series, FrameError>
Check if date is the first day of a quarter.
Matches pd.Series.dt.is_quarter_start.
Sourcepub fn is_quarter_end(&self) -> Result<Series, FrameError>
pub fn is_quarter_end(&self) -> Result<Series, FrameError>
Check if date is the last day of a quarter.
Matches pd.Series.dt.is_quarter_end.
Sourcepub fn strftime(&self, format: &str) -> Result<Series, FrameError>
pub fn strftime(&self, format: &str) -> Result<Series, FrameError>
Format datetime using strftime-like directives.
Matches pd.Series.dt.strftime(format). Supports: %Y, %m, %d, %H, %M, %S.
Sourcepub fn days_in_month(&self) -> Result<Series, FrameError>
pub fn days_in_month(&self) -> Result<Series, FrameError>
Number of days in the month of each datetime.
Matches pd.Series.dt.days_in_month.
Sourcepub fn daysinmonth(&self) -> Result<Series, FrameError>
pub fn daysinmonth(&self) -> Result<Series, FrameError>
Alias for days_in_month(). Matches pd.Series.dt.daysinmonth.
Sourcepub fn is_leap_year(&self) -> Result<Series, FrameError>
pub fn is_leap_year(&self) -> Result<Series, FrameError>
Whether the year of each datetime is a leap year.
Matches pd.Series.dt.is_leap_year.
Sourcepub fn is_year_start(&self) -> Result<Series, FrameError>
pub fn is_year_start(&self) -> Result<Series, FrameError>
Whether each datetime is the start of the year (Jan 1).
Matches pd.Series.dt.is_year_start.
Sourcepub fn is_year_end(&self) -> Result<Series, FrameError>
pub fn is_year_end(&self) -> Result<Series, FrameError>
Whether each datetime is the end of the year (Dec 31).
Matches pd.Series.dt.is_year_end.
Sourcepub fn month_name(&self) -> Result<Series, FrameError>
pub fn month_name(&self) -> Result<Series, FrameError>
Full month name (e.g. “January”) for each datetime.
Matches pd.Series.dt.month_name().
Sourcepub fn day_name(&self) -> Result<Series, FrameError>
pub fn day_name(&self) -> Result<Series, FrameError>
Full day name (e.g. “Monday”) for each datetime.
Matches pd.Series.dt.day_name(). Uses Zeller’s congruence.
Sourcepub fn total_seconds(&self) -> Result<Series, FrameError>
pub fn total_seconds(&self) -> Result<Series, FrameError>
Total seconds for each timedelta value.
Per br-frankenpandas-i9bah: pandas dt.total_seconds() is for timedelta dtype, not datetime. Returns Float64 (fractional seconds supported). Errors if the series contains datetime strings (pandas has no dt.total_seconds() for datetime).
Sourcepub fn to_timestamp(&self) -> Result<Series, FrameError>
pub fn to_timestamp(&self) -> Result<Series, FrameError>
Convert period-like strings to full timestamp strings.
Matches pd.Series.dt.to_timestamp(). For date-only strings (“YYYY-MM-DD”),
appends “00:00:00” to produce a full datetime. Month periods (“YYYY-MM”)
become “YYYY-MM-01 00:00:00”. Year periods (“YYYY”) become “YYYY-01-01 00:00:00”.
Sourcepub fn to_timestamp_with_how(&self, how: &str) -> Result<Series, FrameError>
pub fn to_timestamp_with_how(&self, how: &str) -> Result<Series, FrameError>
Convert period-like strings to full timestamp strings using the requested boundary.
Matches pd.Series.dt.to_timestamp(how='start'|'end') for year/month/day-like periods.
Sourcepub fn to_pydatetime(&self) -> Result<Series, FrameError>
pub fn to_pydatetime(&self) -> Result<Series, FrameError>
Convert datetime-like strings to Python-datetime-compatible strings.
Matches pd.Series.dt.to_pydatetime(warn=...) in observable value output.
Nanoseconds beyond microsecond precision are truncated to match Python’s
datetime precision.
Sourcepub fn to_pydatetime_with_warn(&self, warn: bool) -> Result<Series, FrameError>
pub fn to_pydatetime_with_warn(&self, warn: bool) -> Result<Series, FrameError>
Convert datetime-like strings to Python-datetime-compatible strings, optionally suppressing pandas’ nanosecond-loss warning.
Sourcepub fn floor(&self, freq: &str) -> Result<Series, FrameError>
pub fn floor(&self, freq: &str) -> Result<Series, FrameError>
Round each datetime down (floor) to the given frequency.
Matches pd.Series.dt.floor(freq). Supported frequencies:
“D”, “h”/“H”, “min”/“T”, “s”/“S”, “ms”, “us”, “ns”.
Sourcepub fn ceil(&self, freq: &str) -> Result<Series, FrameError>
pub fn ceil(&self, freq: &str) -> Result<Series, FrameError>
Round each datetime up (ceil) to the given frequency.
Matches pd.Series.dt.ceil(freq). Same frequencies as floor.
Sourcepub fn round(&self, freq: &str) -> Result<Series, FrameError>
pub fn round(&self, freq: &str) -> Result<Series, FrameError>
Round each datetime to the nearest given frequency.
Matches pd.Series.dt.round(freq). Ties round half-to-even on the
frequency-unit count, like pandas. Same frequencies as floor.
Sourcepub fn normalize(&self) -> Result<Series, FrameError>
pub fn normalize(&self) -> Result<Series, FrameError>
Normalize each datetime to midnight (set time to 00:00:00).
Matches pd.Series.dt.normalize(). Equivalent to floor("D").
Sourcepub fn tz_localize(&self, tz: Option<&str>) -> Result<Series, FrameError>
pub fn tz_localize(&self, tz: Option<&str>) -> Result<Series, FrameError>
Localize tz-naive datetimes to a timezone or remove existing timezone data.
Matches pd.Series.dt.tz_localize(tz). Some(tz) appends timezone
info to each naive datetime string. None removes timezone info while
keeping the local clock-time representation.
Sourcepub fn tz_localize_with_options(
&self,
tz: Option<&str>,
options: TzLocalizeOptions,
) -> Result<Series, FrameError>
pub fn tz_localize_with_options( &self, tz: Option<&str>, options: TzLocalizeOptions, ) -> Result<Series, FrameError>
Localize tz-naive datetimes with explicit DST ambiguity/nonexistence policy.
Sourcepub fn tz_convert(&self, tz: Option<&str>) -> Result<Series, FrameError>
pub fn tz_convert(&self, tz: Option<&str>) -> Result<Series, FrameError>
Convert timezone-aware datetimes to a different timezone or to UTC-naive values.
Matches pd.Series.dt.tz_convert(tz). Some(tz) adjusts the UTC offset
and replaces the timezone suffix. None converts through UTC and then
removes timezone information.