date Module

Everything you need to work with dates and timestamps in RQL.

Quick Example

$ Quick Example
$ ctrl+enter to run

Date Extraction

Pull out the parts you need from any date or timestamp.

Date Properties

Inspect properties and boundaries of dates.

Date Manipulation

Add time, compute differences, or grab the current timestamp.

Formatting

Turn dates into readable strings.

Function Reference

FunctionCategoryDescription
date::yearExtractionExtract the year from a date
date::monthExtractionExtract the month (1-12) from a date
date::dayExtractionExtract the day of the month from a date
date::day_of_yearExtractionGet the day of the year (1-366)
date::day_of_weekExtractionGet the day of the week (1=Monday, 7=Sunday)
date::quarterExtractionGet the quarter (1-4)
date::weekExtractionGet the ISO week number (1-53)
date::is_leap_yearPropertiesCheck if a date falls in a leap year
date::days_in_monthPropertiesGet the number of days in the month
date::start_of_monthPropertiesGet the first day of the month
date::end_of_monthPropertiesGet the last day of the month
date::start_of_yearPropertiesGet the first day of the year
date::newManipulationCreate a new date from components
date::nowManipulationGet the current timestamp
date::addManipulationAdd time to a date
date::subtractManipulationSubtract a duration from a date
date::diffManipulationCalculate the difference between two dates
date::truncManipulationTruncate a date to a specified precision
date::ageManipulationCalculate the duration between two dates
date::formatFormattingFormat a date as a string