mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Display local time instead of UTC while restoring previous session (#18775)
Closes #18727 (cherry picked from commit ad19d2c967e896c5426b9d98dfdbc2c4279eb319) Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYvbLU Service-Version: 1.23
This commit is contained in:
parent
3e70851d82
commit
aceb042499
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user