web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Date Time Parameter Plus Time Zone

(0) ShareShare
ReportReport
Posted on by

Scenario:

We have an application where the user preference is Pacific Standard Time.

I have a table that I am using in an SSRS Report and I am querying the table based on createddatetime.

The contract class uses a 'date' parameter.

I pass the date parameter to the DP class and convert it to a utcdatetime data type.

But I need to covert it to UTC date time by adding 7 hours since the date entered by the user will Pacific Standard Time.

Is there better way to do this?

Is there a function I can call to convert Pacific Standard time to UTC.

I'm concerned about day light savings time.

Thanks in advance

 

I have the same question (0)
  • Suggested answer
    zhifeng Profile Picture
    on at

    Can you use expression in SSRS report? 

    =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.ToDisplayStringDate(Parameters!AX_RenderingCulture.Value, Date Field value, "d")

    Or 

    =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, =Fields!TransDate.Value, "d", Parameters!AX_RenderingCulture.Value)

    Read more from: https://docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/troubleshoot-issues-with-printing-and-emailing-reports?redirectedfrom=MSDN

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Brainmaric,

    For data provider converstion you can check also DateTimeUtil class

    docs.microsoft.com/.../convert-from-time-zone-before-persisting-in-x

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    You can use DateTimeUtil::removeTimeZoneOffset(). Also, you'll likely want to use DateTimeUtil::getUserPreferredTimeZone() instead of a hard-coded timezone.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans