Skip to content

Commit

Permalink
Fix timezone issue
Browse files Browse the repository at this point in the history
Convert dates to UTC as we are comparing to LastWriteTimeUtc.
  • Loading branch information
DavidWiseman committed May 25, 2024
1 parent 90ab708 commit 89a03a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sql-log-shipping-service/SQL/GetDatabases.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
AND bs.type IN('D','I','L','P','Q')

)
SELECT d.name,
LR.backup_finish_date,
LR.restore_date
SELECT d.name,
DATEADD(mi,DATEDIFF(mi,GETDATE(),GETUTCDATE()),LR.backup_finish_date) AS backup_finish_date,
DATEADD(mi,DATEDIFF(mi,GETDATE(),GETUTCDATE()),LR.restore_date) AS restore_date
FROM sys.databases d
LEFT OUTER JOIN LR ON d.name = LR.destination_database_name AND LR.rnum=1
WHERE (d.state = 1 OR d.is_in_standby=1)
Expand Down

0 comments on commit 89a03a3

Please sign in to comment.