Skip to content

Query Profiler - Display date time in current time zone#21454

Merged
allancascante merged 2 commits into
mainfrom
dev/allancascante/profiler_local_datetime
Mar 5, 2026
Merged

Query Profiler - Display date time in current time zone#21454
allancascante merged 2 commits into
mainfrom
dev/allancascante/profiler_local_datetime

Conversation

@allancascante
Copy link
Copy Markdown
Contributor

@allancascante allancascante commented Mar 5, 2026

Description

Change to display dates in Query Profiler grid with the system time zone.

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes the profiler's timestamp display from UTC to the user's local timezone, aligning the behavior with SQL Server Management Studio (SSMS). Previously, formatTimestamp used Date.toISOString() which always produces UTC times; now it uses local-time accessors (getFullYear(), getHours(), etc.) to build the formatted string.

Changes:

  • Modified formatTimestamp in profilerConfigService.ts to use local-time Date methods instead of toISOString(), so timestamps display in the user's system timezone
  • Updated test assertions and comments in profilerConfigService.test.ts to reflect the local-timezone behavior, partially adapting assertions to be timezone-independent

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
extensions/mssql/src/profiler/profilerConfigService.ts Replaced toISOString().replace(...) with manual local-time formatting using getFullYear(), getMonth(), etc.
extensions/mssql/test/unit/profiler/profilerConfigService.test.ts Updated timestamp test assertions and comments to account for local-timezone formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread extensions/mssql/test/unit/profiler/profilerConfigService.test.ts Outdated
@allancascante allancascante changed the title Change to display date time in current time zone Query Profiler - Display date time in current time zone Mar 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6391 KB 6386 KB ⚪ -5 KB ( 0% )
sql-database-projects VSIX 7024 KB 7024 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.83%. Comparing base (8deebc1) to head (da926d8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #21454   +/-   ##
=======================================
  Coverage   72.83%   72.83%           
=======================================
  Files         325      325           
  Lines       96419    96426    +7     
  Branches     5411     5411           
=======================================
+ Hits        70227    70234    +7     
  Misses      26192    26192           
Files with missing lines Coverage Δ
...nsions/mssql/src/profiler/profilerConfigService.ts 99.48% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@kburtram kburtram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is what SSMS is doing then it's fine.

Comment thread extensions/mssql/src/profiler/profilerConfigService.ts
@allancascante allancascante merged commit c91df3c into main Mar 5, 2026
3 checks passed
@allancascante allancascante deleted the dev/allancascante/profiler_local_datetime branch March 5, 2026 14:35
@allancascante allancascante linked an issue Mar 10, 2026 that may be closed by this pull request
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sql server profiler StartTime column shows "Invalid Date"

4 participants