projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f566cd
)
TimeProvider GetLocalNow enhancement (#90066)
author
Weihan Li
<weihanli@outlook.com>
Sun, 6 Aug 2023 22:07:22 +0000
(06:07 +0800)
committer
GitHub
<noreply@github.com>
Sun, 6 Aug 2023 22:07:22 +0000
(15:07 -0700)
Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
src/libraries/Common/src/System/TimeProvider.cs
patch
|
blob
|
history
diff --git
a/src/libraries/Common/src/System/TimeProvider.cs
b/src/libraries/Common/src/System/TimeProvider.cs
index
a6e2936
..
9eca00f
100644
(file)
--- a/
src/libraries/Common/src/System/TimeProvider.cs
+++ b/
src/libraries/Common/src/System/TimeProvider.cs
@@
-57,6
+57,10
@@
namespace System
#endif // SYSTEM_PRIVATE_CORELIB
}
TimeSpan offset = zoneInfo.GetUtcOffset(utcDateTime);
+ if (offset.Ticks is 0)
+ {
+ return utcDateTime;
+ }
long localTicks = utcDateTime.Ticks + offset.Ticks;
if ((ulong)localTicks > (ulong)s_maxDateTicks)