This page lists 51 functions in the spql.dt namespace generated from the default SPQL function catalog.
| Function | Kind | Summary |
|---|---|---|
spql.dt.asfreq | scalar function | Validate a period frequency conversion request. |
spql.dt.ceil | scalar function | Ceil a temporal value to a fixed frequency. |
spql.dt.current_date | scalar function | Return the current UTC date. |
spql.dt.current_time | scalar function | Return the current UTC time of day. |
spql.dt.current_timestamp | scalar function | Return the current UTC timestamp. |
spql.dt.day | scalar function | Extract the calendar day of month. |
spql.dt.day_of_week | scalar function | Extract the zero-based weekday where Monday is 0. |
spql.dt.day_of_year | scalar function | Extract the one-based day of year. |
spql.dt.duration_components | scalar function | Split a duration into day-time components. |
spql.dt.duration_total | scalar function | Return a duration total in the requested unit. |
spql.dt.floor | scalar function | Floor a temporal value to a fixed frequency. |
spql.dt.from_epoch | scalar function | Convert an epoch count into a timestamp. |
spql.dt.hour | scalar function | Extract the hour of day. |
spql.dt.is_leap_year | scalar function | Return whether the date belongs to a leap year. |
spql.dt.is_month_end | scalar function | Return whether the date is the last day of its month. |
spql.dt.is_month_start | scalar function | Return whether the date is the first day of its month. |
spql.dt.is_quarter_end | scalar function | Return whether the date ends a quarter. |
spql.dt.is_quarter_start | scalar function | Return whether the date starts a quarter. |
spql.dt.is_year_end | scalar function | Return whether the date ends a year. |
spql.dt.is_year_start | scalar function | Return whether the date starts a year. |
spql.dt.iso_day | scalar function | Extract the ISO weekday where Monday is 1. |
spql.dt.iso_week | scalar function | Extract the ISO week number. |
spql.dt.iso_year | scalar function | Extract the ISO week-numbering year. |
spql.dt.local_time | scalar function | Return the current local time of day. |
spql.dt.local_timestamp | scalar function | Return the current local timestamp. |
spql.dt.minute | scalar function | Extract the minute of hour. |
spql.dt.month | scalar function | Extract the calendar month. |
spql.dt.period_bounds | scalar function | Return half-open date bounds for a period string. |
spql.dt.period_end | scalar function | Return the exclusive end date of a period. |
spql.dt.period_start | scalar function | Return the inclusive start date of a period. |
spql.dt.quarter | scalar function | Extract the calendar quarter. |
spql.dt.round | scalar function | Round a temporal value to a fixed frequency. |
spql.dt.second | scalar function | Extract the second of minute. |
spql.dt.strftime | scalar function | Format a temporal value with a strftime-like pattern. |
spql.dt.to_date | scalar function | Parse a date string. |
spql.dt.to_duration | scalar function | Parse a fixed elapsed duration. |
spql.dt.to_epoch | scalar function | Convert a temporal value into an epoch count. |
spql.dt.to_period | scalar function | Parse a date string as a period label. |
spql.dt.to_time | scalar function | Parse a time string. |
spql.dt.to_timestamp | scalar function | Parse a timestamp string. |
spql.dt.trunc | scalar function | Truncate a temporal value to a named part. |
spql.dt.tz_convert | scalar function | Convert timestamp timezone metadata after validating the zone name. |
spql.dt.tz_localize | scalar function | Attach timezone metadata after validating the zone name. |
spql.dt.year | scalar function | Extract the calendar year. |
spql.dt.bdate_range | generator function | Generate business dates over a bounded range. |
spql.dt.date_range | generator function | Generate date values over a bounded range. |
spql.dt.generate_series | generator function | Generate a SQL-compatible timestamp series. |
spql.dt.period_range | generator function | Generate period labels over a bounded range. |
spql.dt.time_range | generator function | Generate time-of-day values within a bounded range. |
spql.dt.timedelta_range | generator function | Generate fixed elapsed durations over a bounded range. |
spql.dt.timestamp_range | generator function | Generate timestamp values over a bounded range. |
spql.dt.asfreq
Kind: scalar function
Validate a period frequency conversion request.
Signature
spql.dt.asfreq(value, freq)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
freq | yes | No parameter docs. |
spql.dt.ceil
Kind: scalar function
Ceil a temporal value to a fixed frequency.
Signature
spql.dt.ceil(value, freq)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
freq | yes | No parameter docs. |
spql.dt.current_date
Kind: scalar function
Return the current UTC date.
Signature
spql.dt.current_date()
Parameters
No parameters.
spql.dt.current_time
Kind: scalar function
Return the current UTC time of day.
Signature
spql.dt.current_time()
Parameters
No parameters.
spql.dt.current_timestamp
Kind: scalar function
Return the current UTC timestamp.
Signature
spql.dt.current_timestamp()
Parameters
No parameters.
spql.dt.day
Kind: scalar function
Extract the calendar day of month.
Signature
spql.dt.day(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.day_of_week
Kind: scalar function
Extract the zero-based weekday where Monday is 0.
Signature
spql.dt.day_of_week(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.day_of_year
Kind: scalar function
Extract the one-based day of year.
Signature
spql.dt.day_of_year(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.duration_components
Kind: scalar function
Split a duration into day-time components.
Signature
spql.dt.duration_components(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.duration_total
Kind: scalar function
Return a duration total in the requested unit.
Signature
spql.dt.duration_total(value, unit)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
unit | yes | No parameter docs. |
spql.dt.floor
Kind: scalar function
Floor a temporal value to a fixed frequency.
Signature
spql.dt.floor(value, freq)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
freq | yes | No parameter docs. |
spql.dt.from_epoch
Kind: scalar function
Convert an epoch count into a timestamp.
Signature
spql.dt.from_epoch(value, unit)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
unit | yes | No parameter docs. |
spql.dt.hour
Kind: scalar function
Extract the hour of day.
Signature
spql.dt.hour(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_leap_year
Kind: scalar function
Return whether the date belongs to a leap year.
Signature
spql.dt.is_leap_year(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_month_end
Kind: scalar function
Return whether the date is the last day of its month.
Signature
spql.dt.is_month_end(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_month_start
Kind: scalar function
Return whether the date is the first day of its month.
Signature
spql.dt.is_month_start(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_quarter_end
Kind: scalar function
Return whether the date ends a quarter.
Signature
spql.dt.is_quarter_end(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_quarter_start
Kind: scalar function
Return whether the date starts a quarter.
Signature
spql.dt.is_quarter_start(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_year_end
Kind: scalar function
Return whether the date ends a year.
Signature
spql.dt.is_year_end(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.is_year_start
Kind: scalar function
Return whether the date starts a year.
Signature
spql.dt.is_year_start(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.iso_day
Kind: scalar function
Extract the ISO weekday where Monday is 1.
Signature
spql.dt.iso_day(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.iso_week
Kind: scalar function
Extract the ISO week number.
Signature
spql.dt.iso_week(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.iso_year
Kind: scalar function
Extract the ISO week-numbering year.
Signature
spql.dt.iso_year(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.local_time
Kind: scalar function
Return the current local time of day.
Signature
spql.dt.local_time()
Parameters
No parameters.
spql.dt.local_timestamp
Kind: scalar function
Return the current local timestamp.
Signature
spql.dt.local_timestamp()
Parameters
No parameters.
spql.dt.minute
Kind: scalar function
Extract the minute of hour.
Signature
spql.dt.minute(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.month
Kind: scalar function
Extract the calendar month.
Signature
spql.dt.month(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.period_bounds
Kind: scalar function
Return half-open date bounds for a period string.
Signature
spql.dt.period_bounds(value, freq)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
freq | yes | No parameter docs. |
spql.dt.period_end
Kind: scalar function
Return the exclusive end date of a period.
Signature
spql.dt.period_end(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.period_start
Kind: scalar function
Return the inclusive start date of a period.
Signature
spql.dt.period_start(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.quarter
Kind: scalar function
Extract the calendar quarter.
Signature
spql.dt.quarter(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.round
Kind: scalar function
Round a temporal value to a fixed frequency.
Signature
spql.dt.round(value, freq)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
freq | yes | No parameter docs. |
spql.dt.second
Kind: scalar function
Extract the second of minute.
Signature
spql.dt.second(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.strftime
Kind: scalar function
Format a temporal value with a strftime-like pattern.
Signature
spql.dt.strftime(value, format)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
format | yes | No parameter docs. |
spql.dt.to_date
Kind: scalar function
Parse a date string.
Signature
spql.dt.to_date(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.to_duration
Kind: scalar function
Parse a fixed elapsed duration.
Signature
spql.dt.to_duration(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.to_epoch
Kind: scalar function
Convert a temporal value into an epoch count.
Signature
spql.dt.to_epoch(value, unit)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
unit | yes | No parameter docs. |
spql.dt.to_period
Kind: scalar function
Parse a date string as a period label.
Signature
spql.dt.to_period(value, freq)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
freq | yes | No parameter docs. |
spql.dt.to_time
Kind: scalar function
Parse a time string.
Signature
spql.dt.to_time(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.to_timestamp
Kind: scalar function
Parse a timestamp string.
Signature
spql.dt.to_timestamp(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.trunc
Kind: scalar function
Truncate a temporal value to a named part.
Signature
spql.dt.trunc(value, part)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
part | yes | No parameter docs. |
spql.dt.tz_convert
Kind: scalar function
Convert timestamp timezone metadata after validating the zone name.
Signature
spql.dt.tz_convert(value, zone)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
zone | yes | No parameter docs. |
spql.dt.tz_localize
Kind: scalar function
Attach timezone metadata after validating the zone name.
Signature
spql.dt.tz_localize(value, zone, ambiguous?, nonexistent?)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
zone | yes | No parameter docs. |
ambiguous | no | No parameter docs. |
nonexistent | no | No parameter docs. |
spql.dt.year
Kind: scalar function
Extract the calendar year.
Signature
spql.dt.year(value)
Parameters
| Name | Required | Description |
|---|---|---|
value | yes | No parameter docs. |
spql.dt.bdate_range
Kind: generator function
Generate business dates over a bounded range.
Signature
spql.dt.bdate_range(start, end, freq?, inclusive?, weekmask?, holidays?)
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive start date. |
end | yes | Inclusive or exclusive end date. |
freq | no | Business-day frequency, default B. |
inclusive | no | both, left, right, or neither; default both. |
weekmask | no | Business weekdays, default Mon Tue Wed Thu Fri. |
holidays | no | Comma-separated holiday dates to exclude. |
Returns
A date value for each included business day.
spql.dt.date_range
Kind: generator function
This function has multiple public overloads.
spql.dt.date_range(start, end, freq, inclusive?)
Generate date values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.date_range(start, end, periods, inclusive?)
Generate date values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
periods | yes | Number of generated values. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.date_range(start, periods, freq, inclusive?)
Generate date values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Range start. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.date_range(end, periods, freq, inclusive?)
Generate date values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
end | yes | Range end. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.generate_series
Kind: generator function
Generate a SQL-compatible timestamp series.
Signature
spql.dt.generate_series(start, stop, step)
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Start timestamp. |
stop | yes | Stop timestamp. |
step | yes | Fixed elapsed step. |
Returns
Timestamp values in [start, stop] using step.
spql.dt.period_range
Kind: generator function
This function has multiple public overloads.
spql.dt.period_range(start, end, freq, inclusive?)
Generate period labels over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start date. |
end | yes | Inclusive or exclusive range end date. |
freq | yes | Period frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.period_range(start, end, periods, inclusive?, freq?)
Generate period labels over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start date. |
end | yes | Inclusive or exclusive range end date. |
periods | yes | Number of generated values. |
inclusive | no | both, left, right, or neither; default both. |
freq | no | Period frequency. |
Returns
A single top-level value column.
spql.dt.period_range(start, periods, freq, inclusive?)
Generate period labels over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Range start date. |
periods | yes | Number of generated values. |
freq | yes | Period frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.period_range(end, periods, freq, inclusive?)
Generate period labels over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
end | yes | Range end date. |
periods | yes | Number of generated values. |
freq | yes | Period frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.time_range
Kind: generator function
This function has multiple public overloads.
spql.dt.time_range(start, end, freq, inclusive?)
Generate time-of-day values within a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.time_range(start, end, periods, inclusive?)
Generate time-of-day values within a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
periods | yes | Number of generated values. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.time_range(start, periods, freq, inclusive?)
Generate time-of-day values within a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Range start. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.time_range(end, periods, freq, inclusive?)
Generate time-of-day values within a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
end | yes | Range end. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timedelta_range
Kind: generator function
This function has multiple public overloads.
spql.dt.timedelta_range(start, end, freq, inclusive?)
Generate fixed elapsed durations over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timedelta_range(start, end, periods, inclusive?)
Generate fixed elapsed durations over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
periods | yes | Number of generated values. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timedelta_range(start, periods, freq, inclusive?)
Generate fixed elapsed durations over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Range start. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timedelta_range(end, periods, freq, inclusive?)
Generate fixed elapsed durations over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
end | yes | Range end. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timestamp_range
Kind: generator function
This function has multiple public overloads.
spql.dt.timestamp_range(start, end, freq, inclusive?, tz?)
Generate timestamp values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
tz | no | Optional timezone metadata for timestamp ranges. |
Returns
A single top-level value column.
spql.dt.timestamp_range(start, end, periods, inclusive?)
Generate timestamp values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Inclusive or exclusive range start. |
end | yes | Inclusive or exclusive range end. |
periods | yes | Number of generated values. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timestamp_range(start, periods, freq, inclusive?)
Generate timestamp values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
start | yes | Range start. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.
spql.dt.timestamp_range(end, periods, freq, inclusive?)
Generate timestamp values over a bounded range.
Parameters
| Name | Required | Description |
|---|---|---|
end | yes | Range end. |
periods | yes | Number of generated values. |
freq | yes | Fixed elapsed frequency. |
inclusive | no | both, left, right, or neither; default both. |
Returns
A single top-level value column.