Date and time modifiers

Learn how to manipulate date and time in CQL.

Date and time modifiers are natural language functions for manipulating date and time values. These functions are useful for tasks like setting date and time components, converting between time zones, and more.

This is the summary of the available date and time modifiers for quick reference:

ModifierDescription
Set timeAdjusts the time component of a date time value.

Set time

This modifier changes the time component of a date-time value, leaving the date component unchanged. This is useful when you need to indicate a specific time of day, such as noon or midnight, especially when comparing date-time values.

You can use this modifier with any date-time value, including local date times and instants. In the case of local date times, they are first converted to an instant using the default time zone, and then the time component is set.

Syntax

This modifier has the following syntax:

/*<value>*/ at /*<time>*/
Try in Playground

Parameters

These are the supported parameters:

valueDate|DateTime

The date-time value for which to set the time component. This parameter is automatically converted to an instant in the configured time zone if necessary.

timestring|Time

The time you want to set. This can be a time value or a valid ISO 8601 time string, such as 12:00:00 or 12:00.

Examples

Here is a basic example of how to get today's date at noon:

today at "12:00"
Try in Playground

Because the ISO 8601 standard allows you to omit subcomponents of a time value, you can also write the previous example as: