Time Zone Related Types
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
There are several data or object types that are related to date/time or time zone. Also, X++ has several intrinsic functions that are related to date/time or time zone.
Types
The following tables list data and object types that are related to date/time or time zone.
Class – Unrelated to Visual Controls
Type name in X++ |
Description |
---|---|
DateTimeUtil |
A class whose members are mostly static methods. Used for parsing and translating utcdatetime values. For more information, see DateTimeUtil Class. |
Class – Visual Controls
For more information about where visual controls related to date/time are used, see Time Zone and DateTime Display Controls.
Type name in X++ |
Description |
---|---|
FormDateTimeControl |
Displays a date/time value, and enables editing of the value. Translates UTC date/time values both to and from a preferred time zone. |
FormWebDateTime |
Displays a date/time value, and enables editing of the value. Translates UTC date/time values both to and from a preferred time zone. |
ReportDateTimeControl |
Displays a date/time value. Translates a UTC date/time value to a preferred time zone. |
Database Table Columns
Type name |
Description |
---|---|
DateTime |
Stored date/time for a specific hour, minute, and second. Corresponds to utcdatetime in X++. When you create a DateTime field on a table, the system always creates a hidden column with the same name except appended with the four letters TZId. The *TZId column is used to automatically store the time zone and DST information that was used to convert the local date/time to UTC. System created DateTime fields on tables, like CreatedDateTime and ModifiedDateTime, do not have corresponding *TZId fields. |
Date |
Stored date, corresponds to date in X++. There is no *TZId column associated with this type. Date values are not associated with a time zone, and Date values are not converted to any time zone. Birth date is a common example where the Date type is appropriate. No specific Time is associated with a birth date. |
Time |
Stored time, corresponds to the timeOfDay extended data type. There is no *TZId column associated with this type. Time values are not associated with a time zone, and Time values are not converted to any time zone. The daily hours that a business is scheduled to be open is a common example of where the Time type could be used. |
Enums
Type name |
Description |
---|---|
Timezone |
Based on int. An int value of 0 is used for the UTC time zone. |
Extended Data Types
Type name |
Description |
---|---|
timeOfDay |
An integer count of the number of seconds since the start of a day. |
X++ Intrinsic Types
Type name in X++ |
Description |
---|---|
date |
Stores yyyy-mm-dd data, independent of any display format. It is better to use utcdatetime whenever the time component is also needed. |
utcdatetime |
Stores yyyy-mm-dd hh:mm:ss data. Storage is independent of any display format. |
X++ Functions
There are functions intrinsic to X++. A few of these functions are related to date/time.
Functions Directly Related to utcdatetime
The following functions can be used to convert between utcdatetime and string.
Function name |
Description |
---|---|
datetime2Str |
Converts a utcdatetime into a text string. For more information, see datetime2Str Function. |
str2Datetime |
Converts a text string into a utcdatetime. For more information, see str2Datetime Function. |
See also
Time Zone Overview and Terminology
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.