Lean
$LEAN_TAG$
|
Represents the discontinuties in a single time zone and provides offsets to UTC. This type assumes that times will be asked in a forward marching manner. This type is not thread safe. More...
Public Member Functions | |
TimeZoneOffsetProvider (DateTimeZone timeZone, DateTime utcStartTime, DateTime utcEndTime) | |
Initializes a new instance of the TimeZoneOffsetProvider class More... | |
long | GetOffsetTicks (DateTime utcTime) |
Gets the offset in ticks from this time zone to UTC, such that UTC time + offset = local time More... | |
DateTime | ConvertToUtc (DateTime localTime) |
Converts the specified local time to UTC. This function will advance this offset provider More... | |
long | GetNextDiscontinuity () |
Gets this offset provider's next discontinuity More... | |
virtual DateTime | ConvertFromUtc (DateTime utcTime) |
Converts the specified utcTime using the offset resolved from a call to GetOffsetTicks More... | |
Properties | |
DateTimeZone | TimeZone [get] |
Gets the time zone this instances provides offsets for More... | |
Represents the discontinuties in a single time zone and provides offsets to UTC. This type assumes that times will be asked in a forward marching manner. This type is not thread safe.
Definition at line 30 of file TimeZoneOffsetProvider.cs.
QuantConnect.TimeZoneOffsetProvider.TimeZoneOffsetProvider | ( | DateTimeZone | timeZone, |
DateTime | utcStartTime, | ||
DateTime | utcEndTime | ||
) |
Initializes a new instance of the TimeZoneOffsetProvider class
timeZone | The time zone to provide offsets for |
utcStartTime | The start of the range of offsets. Careful here, it will determine the current discontinuity offset value. When requested to convert a date we only look forward for new discontinuities but we suppose the current offset is correct for the requested date if in the past. |
utcEndTime | The end of the range of offsets |
Definition at line 55 of file TimeZoneOffsetProvider.cs.
long QuantConnect.TimeZoneOffsetProvider.GetOffsetTicks | ( | DateTime | utcTime | ) |
Gets the offset in ticks from this time zone to UTC, such that UTC time + offset = local time
utcTime | The time in UTC to get an offset to local |
Definition at line 90 of file TimeZoneOffsetProvider.cs.
DateTime QuantConnect.TimeZoneOffsetProvider.ConvertToUtc | ( | DateTime | localTime | ) |
Converts the specified local time to UTC. This function will advance this offset provider
localTime | The local time to be converted to UTC |
Definition at line 114 of file TimeZoneOffsetProvider.cs.
long QuantConnect.TimeZoneOffsetProvider.GetNextDiscontinuity | ( | ) |
Gets this offset provider's next discontinuity
Definition at line 138 of file TimeZoneOffsetProvider.cs.
|
virtual |
Converts the specified utcTime using the offset resolved from a call to GetOffsetTicks
utcTime | The time to convert from utc |
Definition at line 150 of file TimeZoneOffsetProvider.cs.
|
get |
Gets the time zone this instances provides offsets for
Definition at line 43 of file TimeZoneOffsetProvider.cs.