Imported Upstream version 6.6.0.99

Former-commit-id: eb75b80fa303a4e4686cde0550bb1327e50c0770
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-09-26 09:00:42 +00:00
parent 15bdb7a527
commit b74751f3e5
48 changed files with 301 additions and 46 deletions

View File

@ -1216,10 +1216,13 @@ namespace System
return false;
}
var isUtc = false;
if (dateTime.Kind != DateTimeKind.Utc) {
if (!TryAddTicks (date, -BaseUtcOffset.Ticks, out date, DateTimeKind.Utc))
return false;
}
} else
isUtc = true;
AdjustmentRule current = GetApplicableRule (date);
if (current != null) {
@ -1231,7 +1234,7 @@ namespace System
if (forOffset)
isDst = true;
offset = baseUtcOffset;
if (date >= new DateTime (tStart.Ticks + current.DaylightDelta.Ticks, DateTimeKind.Utc))
if (isUtc || (date >= new DateTime (tStart.Ticks + current.DaylightDelta.Ticks, DateTimeKind.Utc)))
{
offset += current.DaylightDelta;
isDst = true;