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.
|