Page 1 of 1

Azure and GetDate

PostPosted: Mon Feb 04, 2019 3:28 pm
by SBarnes
Hi Mike,

Do the Jiwa stored procedures do anything in terms of GetDate to adjust for time zones?

Re: Azure and GetDate

PostPosted: Mon Feb 04, 2019 3:32 pm
by Scott.Pearce
No.

Re: Azure and GetDate

PostPosted: Mon Feb 04, 2019 3:33 pm
by Scott.Pearce
To elaborate:

We only use SQL Server time for concurrency control. Other date/times (ie. posted date, etc.) are from the client machine.

Re: Azure and GetDate  Topic is solved

PostPosted: Mon Feb 04, 2019 3:39 pm
by SBarnes
Hi Scott

The following although hard coded will work to replace GetDate it is in some stored procedures we have inherited as part of a system

Code: Select all
CREATE FUNCTION  [dbo].[udf_GetDateSyd]()
RETURNS DateTime
AS
BEGIN
    DECLARE @D datetimeoffset;
    SET @D = CONVERT(datetimeoffset, SYSDATETIMEOFFSET()) AT TIME ZONE 'AUS Eastern Standard Time';
    return (CONVERT(datetime,@D));
END
GO