Skip to main content

module  pixeltable.functions.date

Pixeltable UDFs for DateType. Usage example:

udf  add_days()

Signature
Add n days to the date. Equivalent to date + timedelta(days=n). t.d + timedelta(days=n) and t.d - timedelta(days=n) are shorthand for add_days().

udf  day()

Signature
Between 1 and the number of days in the given month of the given year. Equivalent to date.day.

udf  isocalendar()

Signature
Return a dictionary with three entries: 'year', 'week', and 'weekday'. Equivalent to date.isocalendar().

udf  isoformat()

Signature
Return a string representing the date and time in ISO 8601 format. Equivalent to date.isoformat(). Parameters:
  • sep (pxt.String): Separator between date and time.
  • timespec (pxt.String): The number of additional terms in the output. See the date.isoformat() documentation for more details.

udf  isoweekday()

Signature
Return the day of the week as an integer, where Monday is 1 and Sunday is 7. Equivalent to date.isoweekday().

udf  make_date()

Signature
Create a date. Equivalent to datetime().

udf  month()

Signature
Between 1 and 12 inclusive. Equivalent to date.month.

udf  strftime()

Signature
Return a string representing the date and time, controlled by an explicit format string. Equivalent to date.strftime(). Parameters:

udf  strptime()

Signature
Parse a date from date_string according to format. Equivalent to datetime.strptime(date_string, format).date(); see datetime.strptime(). For an ISO 8601 string, astype(pxt.Date) is enough. Parameters:
  • date_string (pxt.String): The string to parse.
  • format (pxt.String): The format of date_string. For a complete list of formatting directives, see strftime() and strptime() Behavior.
Examples:

udf  today()

Signature
Return the current date in the time zone tz, or in the default time zone if tz is None. A query, or a computed column with stored=False, evaluates it when the query runs. A stored computed column records the date of the insert, and a recompute replaces it with the date of the recompute. Parameters: Examples: The tasks that are due today:
The tasks that are due today in Tokyo:

udf  toordinal()

Signature
Return the proleptic Gregorian ordinal of the date, where January 1 of year 1 has ordinal 1. Equivalent to date.toordinal().

udf  weekday()

Signature
Between 0 (Monday) and 6 (Sunday) inclusive. Equivalent to date.weekday().

udf  year()

Signature
Between 1 and 9999 inclusive. (Between MINYEAR and MAXYEAR as defined by the Python datetime library). Equivalent to date.year.
Last modified on December 4, 2026