Show / Hide Table of Contents

Class TimeZoneCalculator

Use this class to get extremely fast timezone conversion data. see Article.

Inheritance
System.Object
TimeZoneCalculator
Namespace: FFT.TimeStamps
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
Type Description
TimeZoneCalculator
| Improve this Doc View Source

GetSegment(TimeStamp)

Returns a TimeZoneCalculator.TimeZoneSegment active at the given timeStamp. The returned segment will have its SegmentKind property set to Utc.

Declaration
public TimeZoneCalculator.TimeZoneSegment GetSegment(TimeStamp timeStamp)
Parameters
Type Name Description
TimeStamp timeStamp
Returns
Type Description
TimeZoneCalculator.TimeZoneSegment
| Improve this Doc View Source

GetSegment(Int64, TimeKind)

Returns a TimeZoneCalculator.TimeZoneSegment active at the given time expressed in ticks in the timezone specified by ticksKind. The returned segment will have its SegmentKind property set to ticksKind.

Declaration
public TimeZoneCalculator.TimeZoneSegment GetSegment(long ticks, TimeKind ticksKind)
Parameters
Type Name Description
System.Int64 ticks
TimeKind ticksKind
Returns
Type Description
TimeZoneCalculator.TimeZoneSegment
| 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
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX