How to get server(AOS) timezone through AX2012 X++ code?

Hi,

How to get server(AOS) timezone through x++ code in AX 2012?

Thanks,

Ambanna Yatnal

Ambanna,

There is a class you can use, called DateTimeUtil, that has a method getSystemDateTime which returns the server’s date and time in UTC format.

//declare variable
utcdatetime timeVar;

timevar = DateTimeUtil::getSystemDateTime();

~S

Hi Silvano,

Thanks for the reply. How do I get which timezone is used in that datetime? say for example GMT+5.5

-Ambanna Yatnal

Hi Ambanna Yatnal,

try this in Job

print xGlobal::machineTzDisplayName();

pause;