Skip to content

Series.Dt (SeriesDtNameSpace) ​

Namespace: Polars.FSharp

Instance Methods ​

AddBusinessDays ​

Add business days (using integer).

fsharp
member AddBusinessDays(
    n: int,
    ?weekMask: bool[],
    ?holidays: seq<DateOnly>,
    ?roll: Roll
) : Series

Parameters

NameTypeDescription
nintThe number of business days to add.
weekMaskbool[] (optional)The week mask.
holidaysseq<DateOnly> (optional)The holidays.
rollRoll (optional)How to handle rolled dates.

Returns: Expression/Series of data type Date or Datetime.


BaseUtcOffset ​

Base offset from UTC. This is usually constant for all datetimes in a given time zone, but may vary in the rare case that a country switches time zone, like Samoa (Apia) did at the end of 2011.

fsharp
member BaseUtcOffset : unit -> Series

Returns: Expression/Series of data type Duration.


Century ​

Extract the century from underlying representation. Returns the century number in the calendar date.

fsharp
member Century : unit -> Series

Returns: Expression/Series of data type Int32.


Combine ​

Combine a date and time into a datetime.

fsharp
member Combine(time: Expr, ?timeUnit: TimeUnit) : Series

Parameters

NameTypeDescription
timeExprThe time to combine with.
timeUnitTimeUnit (optional)The time unit of the time.

Returns: Expression/Series of data type Datetime.


ConvertTimeZone ​

Convert to a different time zone.

fsharp
member ConvertTimeZone(timeZone: string) : Series

Parameters

NameTypeDescription
timeZonestringThe time zone to convert to.

Returns: Expression/Series of data type Datetime.


Date ​

Cast to Date (remove time component).

fsharp
member Date : unit -> Series

Returns: Expression/Series of data type Date.


Day ​

Get the day from the underlying date/datetime.

fsharp
member Day : unit -> Series

Returns: Expression/Series of data type Int32.


DayInMonth ​

Get the number of days in the month from the underlying Date representation.

fsharp
member DayInMonth : unit -> Series

Returns: Expression/Series of data type Int8.


DstOffset ​

Additional offset currently in effect (typically due to daylight saving time).

fsharp
member DstOffset : unit -> Series

Returns: Expression/Series of data type Duration.


Epoch ​

Convert to timestamp.

fsharp
member Epoch(?timeUnit: EpochTimeUnit) : Series

Parameters

NameTypeDescription
timeUnitEpochTimeUnit (optional)The time unit to convert to.

Returns: Expression/Series of data type Int64.


Hour ​

Get the hour from the underlying datetime.

fsharp
member Hour : unit -> Series

Returns: Expression/Series of data type Int32.


IsBusinessDay ​

Check whether the date is a business day.

fsharp
member IsBusinessDay(?weekMask: bool[], ?holidays: seq<DateOnly>) : Series

Parameters

NameTypeDescription
weekMaskbool[] (optional)The week mask.
holidaysseq<DateOnly> (optional)The holidays.

Returns: Expression/Series of data type Boolean.


IsLeapYear ​

Determine whether the year of the underlying date is a leap year.

fsharp
member IsLeapYear : unit -> Series

Returns: Expression/Series of data type Boolean.


IsoYear ​

Get the ISO year from the underlying date/datetime.

fsharp
member IsoYear : unit -> Series

Returns: Expression/Series of data type Int32.


Microsecond ​

Get the microsecond from the underlying datetime.

fsharp
member Microsecond : unit -> Series

Returns: Expression/Series of data type Int32.


Millennium ​

Extract the millennium from underlying representation. Applies to Date and Datetime columns. Returns the millennium number in the calendar date.

fsharp
member Millennium : unit -> Series

Returns: Expression/Series of data type Int32.


Millisecond ​

Get the millisecond from the underlying datetime.

fsharp
member Millisecond : unit -> Series

Returns: Expression/Series of data type Int32.


Minute ​

Get the minute from the underlying datetime.

fsharp
member Minute : unit -> Series

Returns: Expression/Series of data type Int32.


Month ​

Get the month from the underlying date/datetime.

fsharp
member Month : unit -> Series

Returns: Expression/Series of data type Int32.


MonthEnd ​

Roll forward to the last day of the month. For datetimes, the time-of-day is preserved.

fsharp
member MonthEnd : unit -> Series

Returns: Expression/Series of data type Date or Datetime.


MonthStart ​

Roll backward to the first day of the month. For datetimes, the time-of-day is preserved.

fsharp
member MonthStart : unit -> Series

Returns: Expression/Series of data type Date or Datetime.


Nanosecond ​

Get the nanosecond from the underlying datetime.

fsharp
member Nanosecond : unit -> Series

Returns: Expression/Series of data type Int32.


OffsetBy ​

Offset a datetime by a given duration.

fsharp
member OffsetBy(duration: Dur) : Series

Parameters

NameTypeDescription
durationDurThe duration to offset by.

Returns: Expression/Series of data type Date or Datetime.


OrdinalDay ​

Get the ordinal day (day of year) from the underlying date/datetime.

fsharp
member OrdinalDay : unit -> Series

Returns: Expression/Series of data type Int32.


Quarter ​

Get the quarter from the underlying date/datetime.

fsharp
member Quarter : unit -> Series

Returns: Expression/Series of data type Int32.


Replace ​

Replace the date or time components of a datetime.

fsharp
member Replace(
    ?year: int,
    ?month: int,
    ?day: int,
    ?hour: int,
    ?minute: int,
    ?second: int,
    ?microsecond: int,
    ?ambiguous: Expr
) : Series

Parameters

NameTypeDescription
yearint (optional)The new year.
monthint (optional)The new month.
dayint (optional)The new day.
hourint (optional)The new hour.
minuteint (optional)The new minute.
secondint (optional)The new second.
microsecondint (optional)The new microsecond.
ambiguousExpr (optional)How to handle ambiguous times.

Returns: Expression/Series of data type Datetime.


ReplaceTimeZone ​

Replace the time zone of a datetime.

fsharp
member ReplaceTimeZone(timeZone: string option, ?ambiguous: Expr, ?nonExistent: NonExistent) : Series
member ReplaceTimeZone(timeZone: string, ?ambiguous: Expr, ?nonExistent: NonExistent) : Series

Parameters

NameTypeDescription
timeZonestring optionThe new time zone.
ambiguousExpr (optional)How to handle ambiguous times.
nonExistentNonExistent (optional)How to handle non-existent times.

Returns: Expression/Series of data type Datetime.


Round ​

Round a datetime to the nearest multiple of a given duration.

fsharp
member Round(every: Dur) : Series

Parameters

NameTypeDescription
everyDurThe duration to round to.

Returns: Expression/Series of data type Date or Datetime.


Second ​

Get the second from the underlying datetime.

fsharp
member Second(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)-

Returns: Expression/Series of data type Int32.


Strftime ​

Format datetime to string using the given format string (strftime).

fsharp
member Strftime(?format: string) : Series

Parameters

NameTypeDescription
formatstring (optional)The format string to use.

Returns: Expression/Series of data type String.


Time ​

Cast to Time (remove Date component).

fsharp
member Time : unit -> Series

Returns: Expression/Series of data type Time.


Timestamp ​

Convert to timestamp.

fsharp
member Timestamp(?timeUnit: TimeUnit) : Series

Parameters

NameTypeDescription
timeUnitTimeUnit (optional)The time unit to convert to.

Returns: Expression/Series of data type Int64.


TotalDays ​

Extract the total days from a Duration type.

fsharp
member TotalDays(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the day.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


TotalHours ​

Extract the total hours from a Duration type.

fsharp
member TotalHours(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the hour.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


TotalMicroseconds ​

Extract the total microseconds from a Duration type.

fsharp
member TotalMicroseconds(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the microsecond.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


TotalMilliseconds ​

Extract the total milliseconds from a Duration type.

fsharp
member TotalMilliseconds(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the millisecond.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


TotalMinutes ​

Extract the total minutes from a Duration type.

fsharp
member TotalMinutes(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the minute.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


TotalNanoseconds ​

Extract the total nanoseconds from a Duration type.

fsharp
member TotalNanoseconds(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the nanosecond.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


TotalSeconds ​

Extract the total seconds from a Duration type.

fsharp
member TotalSeconds(?fractional: bool) : Series

Parameters

NameTypeDescription
fractionalbool (optional)Whether to include the fractional component of the second.

Returns: Expression/Series of data type Int64 or Float64 if fractional is set.


Truncate ​

Truncate a datetime to the nearest multiple of a given duration.

fsharp
member Truncate(every: Dur) : Series

Parameters

NameTypeDescription
everyDurThe duration to truncate to.

Returns: Expression/Series of data type Date or Datetime.


Weekday ​

Get the weekday from the underlying date/datetime.

fsharp
member Weekday : unit -> Series

Returns: Expression/Series of data type Int32.


Year ​

Get the year from the underlying date/datetime.

fsharp
member Year : unit -> Series

Returns: Expression/Series of data type Int32.


Released under the MIT License. Powered by the Polars Rust core & Apache Arrow.