Page 1 of 1

Azure time zone issues

PostPosted: Thu Dec 05, 2024 2:05 pm
by Riyaz
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.

Re: Azure time zone issues

PostPosted: Thu Dec 05, 2024 4:02 pm
by Mike.Sheen
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.

Re: Azure time zone issues

PostPosted: Thu Dec 05, 2024 4:14 pm
by Riyaz
Hi Mike

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

Re: Azure time zone issues

PostPosted: Thu Dec 05, 2024 4:15 pm
by Mike.Sheen
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?

Re: Azure time zone issues

PostPosted: Thu Dec 05, 2024 4:20 pm
by Riyaz
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

Re: Azure time zone issues  Topic is solved

PostPosted: Thu Dec 05, 2024 4:26 pm
by Mike.Sheen
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.

Re: Azure time zone issues

PostPosted: Thu Dec 05, 2024 4:30 pm
by Riyaz
Understood, thanks Mike