
Originally Posted by
twgonder
Do developers that use one of the various flavors of a SQL Server have a similar problem?
I have one Azure db where GetDate() returns the incorrect date/time relative to where we are (I think it's UTC). I use a function in all my code on that db instead of GetDate() that uses this, which I found somewhere:
Code:
DATEADD(minute, DATEDIFF(minute, '20120101', CAST(GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'Pacific Standard Time' as datetime)), '20120101')
I'd be interested to see if there are better ways, but this works for me...as long as I remember to use it instead of GetDate().