7

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

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
James Moore
  • 2,501
  • 6
  • 26
  • 29

4 Answers4

13

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.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
Rod
  • 401
  • 2
  • 9
7

systemDateGet() and Today()

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

Eaglebird
  • 532
  • 3
  • 5
7

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.

James Moore
  • 2,501
  • 6
  • 26
  • 29
2

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

Sankar Ganesh PMP
  • 11,927
  • 11
  • 57
  • 90