Hi .
I am facing an issue in which my dev box run at australian time zone and I am testing the code from indian time zone , so the requirement is such that we need to get the user time zone instead of getting system time zone .... I know I can get system date time by using getSystemDateTime() .but how to get the local current time zone in with the user is testing .In simple words I want to get windows time whatever is there .
Hi Nishi,
is this question about Dynamics AX 2012 (you posted on AX forum) or D365 F&O?
In most cases you don't need to care about the system (server) timezone at all.
First of all, all timestamps from user transactions are stored as UTC time in the database.
Second, every user defines their time zone in the Dynamics user setup. This setting determines how the UTC timestamps from the database are displayed to the user. And how user's datetime inputs are converted to UTC before storing to database. You can also change the time zone there if you want to test as if you were on a different time zone.
If you need any more help, please let us know what Dynamics product you're talking about, and also please describe all details that you can about your actual test case, and functional requirement. Thanks!
Which version of AX is it about?
In general, the time on the local machine isn't relevant. What counts are two things: system time and user's timezone. If user's timezone is the same as timezone on the local machine, you'll get the local time. But users will get time in their timezone even if a wrong timezone is set up in Windows.
You can also easily test various timezones by changes user settings, completely ignoring what timezone is configured in Windows.
D365Fo .The requirement is that we need to do a naming convention for reports in which timestamp needs to be added on the name of the report .for Ex. SalesInvoice_20210521141900 (taking reference of above image) . but when we run the report we get the timestamp of the system. This is creating confusion for the user as he is not getting the right time at which he is generating the report.
Moved to D365 Finance forum.
You can use UserInfo.PreferredTimeZone field to find out user's timezone. And then you can convert the UTC timestamp to local time for that timezone.
However please take into account that if you don't put absolute (UTC) timestamp in the filename, then the files will not be sorted correctly (chronologically), and the names can even be confusing if users from many time zones are creating them.
the legal entity didnt have the correct timezone set , which led to all these problems .
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 1,933
André Arnaud de Cal... 793 Super User 2025 Season 2
Sohaib Cheema 537 User Group Leader