Class TimeZoneCalculator
Use this class to get extremely fast timezone conversion data.
see Article.
Inheritance
System.Object
TimeZoneCalculator
Assembly: FFT.TimeStamps.dll
Syntax
public sealed class TimeZoneCalculator : object
Properties
|
Improve this Doc
View Source
TimeZone
The timezone for which this offset cache is applicable.
Declaration
public TimeZoneInfo TimeZone { get; }
Property Value
Type |
Description |
TimeZoneInfo |
|
Methods
|
Improve this Doc
View Source
Convert(TimeZoneInfo, TimeZoneInfo, Int64)
Converts fromTimeZoneTicks
from fromTimeZone
to toTimeZone
.
Compute intensive. Do not use in hot path.
Declaration
public static long Convert(TimeZoneInfo fromTimeZone, TimeZoneInfo toTimeZone, long fromTimeZoneTicks)
Parameters
Type |
Name |
Description |
TimeZoneInfo |
fromTimeZone |
|
TimeZoneInfo |
toTimeZone |
|
System.Int64 |
fromTimeZoneTicks |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Get(TimeZoneInfo)
Gets the TimeZoneOffsetCache for the given timeZone.
Declaration
public static TimeZoneCalculator Get(TimeZoneInfo timeZone)
Parameters
Type |
Name |
Description |
TimeZoneInfo |
timeZone |
|
Returns
|
Improve this Doc
View Source
GetSegment(TimeStamp)
Declaration
public TimeZoneCalculator.TimeZoneSegment GetSegment(TimeStamp timeStamp)
Parameters
Returns
|
Improve this Doc
View Source
GetSegment(Int64, TimeKind)
Declaration
public TimeZoneCalculator.TimeZoneSegment GetSegment(long ticks, TimeKind ticksKind)
Parameters
Type |
Name |
Description |
System.Int64 |
ticks |
|
TimeKind |
ticksKind |
|
Returns
|
Improve this Doc
View Source
ToTimeZoneTicks(Int64)
Converts utc ticks to timezone ticks.
Compute intensive. Do not use in hot path.
Declaration
public long ToTimeZoneTicks(long utcTicks)
Parameters
Type |
Name |
Description |
System.Int64 |
utcTicks |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
ToUtcTicks(Int64)
Converts timezone ticks to utc ticks.
Ambiguous times are considered to be in the standard (not daylight savings) offset.
Invalid times are considered to be in the standard (not daylight savings) offset.
Compute intensive. Do not use in hot path.
Declaration
public long ToUtcTicks(long timeZoneTicks)
Parameters
Type |
Name |
Description |
System.Int64 |
timeZoneTicks |
|
Returns
Type |
Description |
System.Int64 |
|