systemDateGet Function

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

Retrieves the session date if it has been set.

date systemDateGet()

Return Value

The session date if has been set; otherwise, the system date.


The user should consider using the menu Tools > Session date and time to start the Session date and time form. The form can be used to actively set the session date. After this set action is detected by the system, subsequent calls to the systemDateGet function return the session date.

The today function returns the system date.

This function does not support time zones.


The following example displays the date in the Infolog window.

    static void Job_systemDateGet(Args _arg)
        info( date2Str( 
            systemDateGet(),  // X++ language function.
            321,  // 321 = ymd
            DateSeparator::Hyphen, // separator1
            DateSeparator::Hyphen, // separator2
    /*********** Actual Infolog output
    Message (03:46:00 pm)

See also

DateTimeUtil Class

systemDateSet Function

today Function

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).