Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

Batch Schedule Time Zone Problem

Posted on by

We have a time zone problem.  We want to invoice sales orders as a batch process. 

Our AOS system date/time is 8 hours ahead.  

The problem is that sometimes the invoice date is posted same day (Pacific Time) and sometimes (after 4:00 pm) it is posted the next day.

It's like it's sometimes converting to Pacific Time and other times not.

Does anyone know why this happens?

Is there a hotfix?

Thanks in Advance.

Categories:
  • Martin Dráb Profile Picture
    Martin Dráb 228,588 Most Valuable Professional on at
    RE: Batch Schedule Time Zone Problem

    CustInvoiceJour.InvoiceDate seems to be initialized (in the most common case) in CustInvoiceJour.initFromCustTable() by systemDateGet(). I think it will return the date of the machine running the AOS, therefore you have two options:

    1. Change the timezone of the server to be PST. This is the preferred way if you can do it.
    2. Or change the code to apply the company timezone.
  • brianmaric Profile Picture
    brianmaric on at
    RE: Batch Schedule Time Zone Problem

    sounds like the right answer but we don't have an AOS that uses PST..

  • Guy Terry Profile Picture
    Guy Terry 28,508 Super User 2024 Season 2 on at
    RE: Batch Schedule Time Zone Problem

    Post the invoices using an AOS that is running on a server that is using PST.

  • brianmaric Profile Picture
    brianmaric on at
    RE: Batch Schedule Time Zone Problem

    We want the posting date to be Pacific Standard Time.   What's the best way to do that?

  • Guy Terry Profile Picture
    Guy Terry 28,508 Super User 2024 Season 2 on at
    RE: Batch Schedule Time Zone Problem

    I don't think a code change is the way to fix this. Why is your AOS set to GMT?

    Can you trace the odd results you see to daylight savings? There is a one or two week difference between when PST and GMT observe summer time.

    Do you have multiple AOSes that can run batch jobs (perhaps in different time zones)?

  • brianmaric Profile Picture
    brianmaric on at
    RE: Batch Schedule Time Zone Problem

    Yes, it is set to GMT.

    But the problem is that the behavior is not consistent.

    If we set schedule the batch process to run at 4:10 pm Pacific Standard Time, then it is officially the next day GMT (it being 12:10 AM).

    Now, sometimes it adds the extra day and sometimes it does not.  I can' see why.   So it is difficult to correct in code.

  • Guy Terry Profile Picture
    Guy Terry 28,508 Super User 2024 Season 2 on at
    RE: Batch Schedule Time Zone Problem

    Are you saying the server with your AOS is set to GMT, London, UTC or similar?

    I think this could be your problem. Per an explanation here, the Invoice Date field is a Date-only field. It is not Time Zone 'aware'.

    msdn.microsoft.com/.../cc518263.aspx

    It will contain whatever date the server running the AOS has at the time of the posting.

  • brianmaric Profile Picture
    brianmaric on at
    RE: Batch Schedule Time Zone Problem

    Yes, if I look at the system date time displayed in the lower corner of the server, it shows as exactly 8 hours ahead of Pacific Time.

  • Martin Dráb Profile Picture
    Martin Dráb 228,588 Most Valuable Professional on at
    RE: Batch Schedule Time Zone Problem

    Can you please answer what you mean by "the system date on the AOS"? Thank you.

  • brianmaric Profile Picture
    brianmaric on at
    RE: Batch Schedule Time Zone Problem

    ok...

    I just looked it up...

    The Preferred Time Zone is set to Pacific Time

    The Company Time Zone is set to Pacific Time

    The field concerned is the CustInvoiceJour.invoicedate

    This date seems to come from the SalesParmTable.transdate which appears to system generated when running the batch process.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans