Azure time zone issues

Discussions relating to plugin development, and the Jiwa API.

Azure time zone issues

Postby Riyaz » Thu Dec 05, 2024 2:05 pm

Hi There

We have a problem in Azure SQL db where the database assumes a different timezone than whats set on the azure sql server. Please let me know how to solve this as we are getting some time travel issues within Jiwa.
Riyaz
Kohai
Kohai
 
Posts: 250
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Azure time zone issues

Postby Mike.Sheen » Thu Dec 05, 2024 4:02 pm

Riyaz wrote:Hi There

We have a problem in Azure SQL db where the database assumes a different timezone than whats set on the azure sql server. Please let me know how to solve this as we are getting some time travel issues within Jiwa.


Why is it a problem?

Azure SQL is always UTC as far as I was aware, and that cannot be changed, and you shouldn't need to, or care about it.

When you create a document (say a PO) in Jiwa the date/time used for the document date is that of the Windows environment running the application - so in your Azure VM you should have set the region and timezone to suit your needs. The Azure SQL Server stores what dates it's been given, except for LastSavedDateTime which is the SQL Server date and is used for concurrency control.

If you're doing something that relies on our LastSavedDateTime fields to be the same timezone as your application, then you need to adjust your comparisons to convert the UTC time to local time.

I can only guess really what your best course of action is because you never said what the problem is.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2497
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: Azure time zone issues

Postby Riyaz » Thu Dec 05, 2024 4:14 pm

Hi Mike

Pls see the attached, the time of the email sent is set to the DB time but actual sent time not that
Attachments
wrongtime.png
wrongtime.png (8.83 KiB) Viewed 1995 times
Riyaz
Kohai
Kohai
 
Posts: 250
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Azure time zone issues

Postby Mike.Sheen » Thu Dec 05, 2024 4:15 pm

Riyaz wrote:Hi Mike

Pls see the attached, the time of the email sent is set to the DB time but actual sent time not that


So?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2497
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: Azure time zone issues

Postby Riyaz » Thu Dec 05, 2024 4:20 pm

Am email was just sent out this invoice to a customer today (05/12 at 10:35am) and the recipient got it at 05/12/2024 @ 10.38AM, BUT the system shows that it was emailed at 04/12/2024 @ 9:37PM…just that its creating lots of confusions
Riyaz
Kohai
Kohai
 
Posts: 250
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Azure time zone issues

Postby Mike.Sheen » Thu Dec 05, 2024 4:26 pm

Riyaz wrote:Am email was just sent out this invoice to a customer today (05/12 at 10:35am) and the recipient got it at 05/12/2024 @ 10.38AM, BUT the system shows that it was emailed at 04/12/2024 @ 9:37PM…just that its creating lots of confusions


I see.

Like I said, we use the SQL Server Date Time for some fields such as LastSavedDateTime columns - specifically in this case we're inserting into the SO_EmailLog table and using GETDATE() as the value for the EmailDateTime.

If you want the EmailDateTime displayed in the local time zone, a plugin can adjust the values whenever a sales order is read.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2497
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: Azure time zone issues

Postby Riyaz » Thu Dec 05, 2024 4:30 pm

Understood, thanks Mike
Riyaz
Kohai
Kohai
 
Posts: 250
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests