skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : To time: Casting a dateTime to a time
 

Try Corticon Now

To time: Casting a dateTime to a time

SYNTAX

<DateTime>.toTime

DESCRIPTION

Converts the value in <DateTime> to a Time data type, containing only the time portion of the full DateTime. If <DateTime> contains no time information, then the time portion is set to 12:00:00 AM in the current timezone.
Note: Should this value be saved in a database field supporting a full DateTime, the date portion is saved as the epoch specified in com.corticon.crml.OclDate.epochForTimeValues. See Server Integration & Deployment Guide for a complete description of this and other Common properties.

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 .toTime to convert dateTime1 to Time and assign the value to TimeOnly1.

SAMPLE TEST