static class · System
LocalZone
static class LocalZone
The local time zone's offset from UTC, asked of the system once per quarter hour of UTC (zones change their offset only on quarter hours).
- Kind
- static class
- Namespace
- System
- Assembly
- System.Core
- Access
- internal, static, abstract
- Source file
Time.ant
Inheritance
- Base classes
-
AnyLocalZone
Methods
The offset in ticks at a UTC moment (ticks since 0001).
The offset in ticks at a local moment: the offset at the moment it would be in UTC, checked once more (near a change the two can differ).
Private and internal members (3)
Inherited members (5)
GetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Anydestroymethod from Any
Source
LocalZone as Antril, decompiled from its Larva HIR.
// System.LocalZone — System.Core (decompiled from Larva HIR)
into namespace System
{
/// The local time zone's offset from UTC, asked of the system once per quarter hour of UTC (zones change their offset
/// only on quarter hours).
static class LocalZone
{
i64 quarter = -9223372036854775808;
i64 cached;
extern("time.offset") OffsetAt(i64 seconds) : i64;
public:
/// The offset in ticks at a UTC moment (ticks since 0001).
Offset(i64 utcTicks) : i64
{
i64 seconds = utcTicks / 10000000 - 62135596800;
i64 at = seconds >= 0 ? seconds / 900 : (seconds - 899) / 900;
if (at != quarter)
{
cached = OffsetAt(seconds) * 10000000;
quarter = at;
}
return cached;
}
/// The offset in ticks at a local moment: the offset at the moment it would be in UTC, checked once more
/// (near a change the two can differ).
OffsetOfLocal(i64 localTicks) : i64
{
i64 first = Offset(localTicks);
i64 second = Offset(localTicks - first);
return second;
}
}
}