module pixeltable.functions.date
Pixeltable UDFs forDateType.
Usage example:
udf add_days()
Signature
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
date.day.
udf isocalendar()
Signature
'year', 'week', and 'weekday'.
Equivalent to
date.isocalendar().
udf isoformat()
Signature
date.isoformat().
Parameters:
sep(pxt.String): Separator between date and time.timespec(pxt.String): The number of additional terms in the output. See thedate.isoformat()documentation for more details.
udf isoweekday()
Signature
date.isoweekday().
udf make_date()
Signature
datetime().
udf month()
Signature
date.month.
udf strftime()
Signature
date.strftime().
Parameters:
format(pxt.String): The format string to control the output. For a complete list of formatting directives, seestrftime()andstrptime()Behavior.
udf strptime()
Signature
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, seestrftime()andstrptime()Behavior.
udf today()
Signature
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:
tz(pxt.String | None): A time zone name from the IANA Time Zone Database, such as'America/New_York'.
udf toordinal()
Signature
date.toordinal().
udf weekday()
Signature
date.weekday().
udf year()
Signature
MINYEAR and
MAXYEAR as defined by the Python datetime
library).
Equivalent to date.year.