Repository: microsoft/terminal (language: cpp)

Issue:
[Restored ...] messages shows UTC time instead of local time
### Windows Terminal version

1.22.10731.0

### Windows build number

10.0.26100.3476

### Other Software

_No response_

### Steps to reproduce

- Open Terminal
- Open several tabs
- Close Terminal 
- Open it again
- It restores opened tabs, but the restoration date shows UTC time instead of the local time. See screenshot

![Image](https://github.com/user-attachments/assets/1d579691-4baf-4bc5-86a8-d29702606fe7)

### Expected Behavior

Show the local time or add a timezone information at the end of the date

### Actual Behavior

Shows UTC time


Discussion / hints:
LOL. How have we never noticed this?

Fix patch:
diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp
index 7c57fda7d0c..0a94352e724 100644
--- a/src/cascadia/TerminalControl/ControlCore.cpp
+++ b/src/cascadia/TerminalControl/ControlCore.cpp
@@ -1831,9 +1831,23 @@ namespace winrt::Microsoft::Terminal::Control::implementation
         }
 
         FILETIME lastWriteTime;
+        FILETIME localFileTime;
         SYSTEMTIME lastWriteSystemTime;
-        if (!GetFileTime(file.get(), nullptr, nullptr, &lastWriteTime) ||
-            !FileTimeToSystemTime(&lastWriteTime, &lastWriteSystemTime))
+
+        // Get the last write time in UTC
+        if (!GetFileTime(file.get(), nullptr, nullptr, &lastWriteTime))
+        {
+            return;
+        }
+
+        // Convert UTC FILETIME to local FILETIME
+        if (!FileTimeToLocalFileTime(&lastWriteTime, &localFileTime))
+        {
+            return;
+        }
+
+        // Convert local FILETIME to SYSTEMTIME
+        if (!FileTimeToSystemTime(&localFileTime, &lastWriteSystemTime))
         {
             return;
         }


Test patch: