skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Hour
 

Try Corticon Now

Hour

SYNTAX

<DateTime>.hour
<Time>.hour

DESCRIPTION

Returns the hour portion of <DateTime> or <Time>. The returned value is based on a 24-hour clock. For example, 10:00 PM (22:00 hours) is returned as 22.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

The following Rulesheet uses .hour to evaluate dateTime1 and assign the hour value to integer1.

SAMPLE RULETEST

A sample Ruletest provides three examples of dateTime1. Input and Output panels are shown below. Notice that the hour returned is dependent upon the timezone of the machine executing the rule. The hour returned is independent of the machine running the Ruletest and only depends on the locale/timezone of the data itself.