Query Profiler - Display date time in current time zone#21454
Conversation
There was a problem hiding this comment.
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
formatTimestampinprofilerConfigService.tsto use local-timeDatemethods instead oftoISOString(), so timestamps display in the user's system timezone - Updated test assertions and comments in
profilerConfigService.test.tsto 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.
PR Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
kburtram
left a comment
There was a problem hiding this comment.
If this is what SSMS is doing then it's fine.
Description
Change to display dates in Query Profiler grid with the system time zone.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines