diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs index 3cb0528..2764dc9 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs @@ -362,6 +362,7 @@ private async Task ShowConnectionDialogAsync() await PopulateDatabases(); await FetchServerMetadataAsync(); + await FetchServerUtcOffset(); if (_selectedDatabase != null) { @@ -439,6 +440,22 @@ private async Task FetchServerMetadataAsync() } } + private async Task FetchServerUtcOffset() + { + if (_connectionString == null) return; + try + { + await using var conn = new SqlConnection(_connectionString); + await conn.OpenAsync(); + await using var cmd = new SqlCommand( + "SELECT DATEDIFF(MINUTE, GETUTCDATE(), GETDATE())", conn); + var offset = await cmd.ExecuteScalarAsync(); + if (offset is int mins) + PlanViewer.Core.Services.TimeDisplayHelper.ServerUtcOffsetMinutes = mins; + } + catch { } + } + private async Task FetchDatabaseMetadataAsync() { if (_connectionString == null || _serverMetadata == null) return; diff --git a/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml b/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml index bff0fb5..697ad74 100644 --- a/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml +++ b/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml @@ -67,6 +67,15 @@ Watermark="0x1AB2C3, dbo.MyProc" KeyDown="SearchValue_KeyDown"/> + + + + + + + +