What is the function to get the system date and current date in Dynamics AX?

73,361

Solution 1

Use the static methods within class DateTimeUtil:

Both return UTC date and times, but will be converted to local time on display.

See Best Practice.

Solution 2

systemDateGet() and Today()

http://msdn.microsoft.com/en-us/library/aa672952.aspx

Solution 3

In Dynamics Ax < 2009

Current Date:

Today()

The system date provided by the today function should be used only where the actual machine date is needed.

System Date:

SystemDateGet()

Most application logic should use the system function systemDateGet, which holds the logic date of the system.

Solution 4

SystemDateGet() is the command to get current date in a display method.

today() method, which might return a different date (it returns the machine date, not the date from Dynamics AX).

Share:
73,361
James Moore
Author by

James Moore

I

Updated on July 30, 2022

Comments

  • James Moore
    James Moore almost 2 years

    What are the function calls to get the System Date and Current Date using X++ in Microsoft Dynamics AX?

  • user85421
    user85421 over 13 years
    SystemDateGet is deprecated, use the methods from DateTimeUtil instead.