Date Functions ============== .. type:: date Enter dates in Beanquery by writing them in the format ``YYYY-MM-DD``. Example: ``SELECT account, amount FROM date >= 2022-01-01``. Note: Do *not* enclose them in quotes. For historical reasons, dates in double quotes are accepted, but this is deprecated. The following functions are available for inspecting and manipulating dates: * :func:`~fun.date` - Construct a date with year, month, day arguments. * :func:`~fun.date_add` - Adds/subtracts number of days from the given date. * :func:`~fun.date_bin` - Bin a date into the specified stride aligned with the specified origin. * :func:`~fun.date_diff` - Calculates the difference (in days) between two dates. * :func:`~fun.date_part` - Extract the specified field from a date. * :func:`~fun.date_trunc` - Truncate a date to the specified precision. * :func:`~fun.day` - Extract the day from a date. * :func:`~fun.interval` - Construct a relative time interval. * :func:`~fun.month` - Extract the month from a date. * :func:`~fun.parse_date` - Parse date from string (first argument). * :func:`~fun.quarter` - Extract the quarter from a date. * :func:`~fun.today` - Today's date. * :func:`~fun.weekday` - Extract a 3-letter weekday from a date. * :func:`~fun.year` - Extract the year from a date. * :func:`~fun.yearmonth` - Extract the year and month from a date.