Jaa


TimeOfDay

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

The timeOfDay or time data type is an integer value representing the number of seconds that have elapsed since midnight.

Range

The range of a timeOfDay data type is in the closed interval [0; 86400]. Values above 86400 (23:59:59) cannot be interpreted.

Declaring timeOfDay Variables

TimeOfDay declaration

=

timeOfDay Variable { , Variable } ;

variable

=

identifier [ option ]

option

=

Arrayoptions | initialization

    //Declaration of a time variable, time1
    timeOfDay time1;
     
    //Declaration and initialization of a time variable to 00:21:35
    timeOfDay time2 = 1295;

Time Literals

timeOfDay variables can be used as literals in the same way as integers are used as literals.

Automatic Conversions

The same automatic conversions that are available for integers are also available for timeOfDay variables (Booleans, enums, and reals).

Using Times in Expressions

Any operations that can be performed with integers can also be performed with timeOfDay variables.

Overview of timeOfDay

Keyword

timeOfDay

Size

32 bits

Scope of data type

[0; 86400]

Default value

0

Implicit conversions

Automatically converted to real, boolean, and enum

Explicit conversions

str2time, time2str

See also

Data Types in X++

Variables

str2Time Function

time2Str Function

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.