$getHour

$getHour operator returns you the hour of the datetime. You can use this in any Expression Object

Syntax

{
    "$getHour": [<datetime_like_obj>]
}

Properties

FieldDescriptionRequired

<datetime_like_obj>

The <datetime_like_obj> expression can be any valid expression as long as it resolves to datetime objects. It can also be a Magical Autocomplete.

true

Returns

integer - The hour of the datetime provided

Examples

Basic Example

{
    "$getHour": ["2024-07-17 06:34:53"]
}

The above expression returns 6

With Magical Autocomplete

Let's say we have declared a variable temp of type datetime which has value of 2024-07-17 06:34:53 currently.

{
    "$getHour": [ "$.variables.temp" ]
}

The above expression would resolve to a result of 6

Last updated