systemDateGet Function [AX 2012]

Updated: April 19, 2012

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()

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
        DateDay::Digits2,

        DateSeparator::Hyphen, // separator1
        DateMonth::Digits2,
        DateSeparator::Hyphen, // separator2

        DateYear::Digits4
        )
    );
/*********** Actual Infolog output
Message (03:46:00 pm)
2012-04-16
***********/
}

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

Community Additions

ADD
Show: