datetime2Str Function [AX 2012]
Updated: November 21, 2009
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Converts a utcdatetime value into a string.
str datetime2Str(
utcdatetime datetime
[, int flags = DateFlags::None])
Null Date-Time Input
If the minimum utcdatetime value is input for the datetime parameter, the datetime2Str function treats it as a null input value. This causes the function to return an empty string.
The date-time of 1900-01-01T00:00:00 is returned by the DateTimeUtil::minValue method. This minimum value is treated as null.
Right- to-Left Local Settings
The default behavior of this function is to output the string in left-to-right sequence, with the year portion leftmost. However, the flags parameter value of the DateFlags::FormatAll enumeration value directs the function to output in right-to-left sequence if the local settings are configured for right-to-left.
The format of the toStr method of the DateTimeUtil class is unaffected by regional settings.
Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).