Skip to content

Add DST ambiguity note to TzSpecificLocalTimeToSystemTime(Ex) documentation #2065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: docs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ If the function fails, the return value is zero. To get extended error informati

<b>TzSpecificLocalTimeToSystemTime</b> takes into account whether daylight saving time (DST) is in effect for the local time to be converted.

> [!IMPORTANT]
> Certain local times near DST transitions may be <b>ambiguous</b> or <b>invalid</b>. Specifying such a time can result in unexpected behavior as there is no guaranteed "correct" result.
> - During the transition from daylight time to standard time, the local clock repeats. A local time within the repeated window is ambiguous because it occurs twice, once in daylight time and once in standard time.
> - During the transition from standard time to daylight time, the local clock jumps forward. A local time within the skipped window does not have a valid UTC conversion.
>
> Applications requiring continuity or precision should avoid relying on this function and look to use UTC time directly instead.

## -see-also

<a href="/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtime">GetSystemTime</a>
Expand All @@ -114,4 +121,4 @@ If the function fails, the return value is zero. To get extended error informati



<a href="/windows/desktop/SysInfo/time-functions">Time Functions</a>
<a href="/windows/desktop/SysInfo/time-functions">Time Functions</a>
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,15 @@ A pointer to a
## -returns

If the function fails, the return value is zero. To get extended error information, call
<a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.
<a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.

## -remarks

<b>TzSpecificLocalTimeToSystemTimeEx</b> takes into account whether daylight saving time (DST) is in effect for the local time to be converted.

> [!IMPORTANT]
> Certain local times near DST transitions may be <b>ambiguous</b> or <b>invalid</b>. Specifying such a time can result in unexpected behavior as there is no guaranteed "correct" result.
> - During the transition from daylight time to standard time, the local clock repeats. A local time within the repeated window is ambiguous because it occurs twice, once in daylight time and once in standard time.
> - During the transition from standard time to daylight time, the local clock jumps forward. A local time within the skipped window does not have a valid UTC conversion.
>
> Applications requiring continuity or precision should avoid relying on this function and look to use UTC time directly instead.