Lean  $LEAN_TAG$
QuantConnect.TimeKeeper Class Reference

Provides a means of centralizing time for various time zones. More...

Inheritance diagram for QuantConnect.TimeKeeper:
[legend]

Public Member Functions

 TimeKeeper (DateTime utcDateTime, params DateTimeZone[] timeZones)
 Initializes a new instance of the TimeKeeper class at the specified UTC time and for the specified time zones. Each time zone specified will cause the creation of a LocalTimeKeeper to handle conversions for that time zone. More...
 
 TimeKeeper (DateTime utcDateTime, IEnumerable< DateTimeZone > timeZones)
 Initializes a new instance of the TimeKeeper class at the specified UTC time and for the specified time zones. Each time zone specified will cause the creation of a LocalTimeKeeper to handle conversions for that time zone. More...
 
void SetUtcDateTime (DateTime utcDateTime)
 Sets the current UTC time for this time keeper and the attached child LocalTimeKeeper instances. More...
 
DateTime GetTimeIn (DateTimeZone timeZone)
 Gets the local time in the specified time zone. If the specified DateTimeZone has not already been added, this will throw a KeyNotFoundException. More...
 
LocalTimeKeeper GetLocalTimeKeeper (DateTimeZone timeZone)
 Gets the LocalTimeKeeper instance for the specified time zone More...
 
void AddTimeZone (DateTimeZone timeZone)
 Adds the specified time zone to this time keeper More...
 

Properties

DateTime UtcTime [get]
 Gets the current time in UTC More...
 
- Properties inherited from QuantConnect.Interfaces.ITimeKeeper
DateTime UtcTime [get]
 Gets the current time in UTC More...
 

Detailed Description

Provides a means of centralizing time for various time zones.

Definition at line 27 of file TimeKeeper.cs.

Constructor & Destructor Documentation

◆ TimeKeeper() [1/2]

QuantConnect.TimeKeeper.TimeKeeper ( DateTime  utcDateTime,
params DateTimeZone[]  timeZones 
)

Initializes a new instance of the TimeKeeper class at the specified UTC time and for the specified time zones. Each time zone specified will cause the creation of a LocalTimeKeeper to handle conversions for that time zone.

Parameters
utcDateTimeThe initial time
timeZonesThe time zones used to instantiate LocalTimeKeeper instances.

Definition at line 48 of file TimeKeeper.cs.

◆ TimeKeeper() [2/2]

QuantConnect.TimeKeeper.TimeKeeper ( DateTime  utcDateTime,
IEnumerable< DateTimeZone >  timeZones 
)

Initializes a new instance of the TimeKeeper class at the specified UTC time and for the specified time zones. Each time zone specified will cause the creation of a LocalTimeKeeper to handle conversions for that time zone.

Parameters
utcDateTimeThe initial time
timeZonesThe time zones used to instantiate LocalTimeKeeper instances.

Definition at line 60 of file TimeKeeper.cs.

Member Function Documentation

◆ SetUtcDateTime()

void QuantConnect.TimeKeeper.SetUtcDateTime ( DateTime  utcDateTime)

Sets the current UTC time for this time keeper and the attached child LocalTimeKeeper instances.

Parameters
utcDateTimeThe current time in UTC

Definition at line 70 of file TimeKeeper.cs.

◆ GetTimeIn()

DateTime QuantConnect.TimeKeeper.GetTimeIn ( DateTimeZone  timeZone)

Gets the local time in the specified time zone. If the specified DateTimeZone has not already been added, this will throw a KeyNotFoundException.

Parameters
timeZoneThe time zone to get local time for
Returns
The local time in the specifed time zone

Definition at line 85 of file TimeKeeper.cs.

Here is the call graph for this function:

◆ GetLocalTimeKeeper()

LocalTimeKeeper QuantConnect.TimeKeeper.GetLocalTimeKeeper ( DateTimeZone  timeZone)

Gets the LocalTimeKeeper instance for the specified time zone

Parameters
timeZoneThe time zone whose LocalTimeKeeper we seek
Returns
The LocalTimeKeeper instance for the specified time zone

Implements QuantConnect.Interfaces.ITimeKeeper.

Definition at line 95 of file TimeKeeper.cs.

Here is the caller graph for this function:

◆ AddTimeZone()

void QuantConnect.TimeKeeper.AddTimeZone ( DateTimeZone  timeZone)

Adds the specified time zone to this time keeper

Parameters
timeZone

Implements QuantConnect.Interfaces.ITimeKeeper.

Definition at line 110 of file TimeKeeper.cs.

Property Documentation

◆ UtcTime

DateTime QuantConnect.TimeKeeper.UtcTime
get

Gets the current time in UTC

Definition at line 37 of file TimeKeeper.cs.


The documentation for this class was generated from the following file: