Class DefaultTimeSource
Provides default time source implementation which is build on DateTime local class
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Azos.Time
Assembly: Azos.dll
Syntax
public class DefaultTimeSource : ApplicationComponent, ITimeSourceImplementation, ITimeSource, IApplicationComponent, ILocalizedTimeProvider, IDisposable, IConfigurable
Constructors
DefaultTimeSource(IApplication)
Declaration
public DefaultTimeSource(IApplication app)
Parameters
Type | Name | Description |
---|---|---|
IApplication | app |
Properties
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
LocalizedTime
Returns current time localized per TimeLocation
Declaration
public DateTime LocalizedTime { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Now
Declaration
public DateTime Now { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
TimeLocation
Declaration
public TimeLocation TimeLocation { get; }
Property Value
Type | Description |
---|---|
TimeLocation |
UTCNow
Declaration
public DateTime UTCNow { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Methods
Configure(IConfigSectionNode)
Declaration
public void Configure(IConfigSectionNode node)
Parameters
Type | Name | Description |
---|---|---|
IConfigSectionNode | node |
LocalizedTimeToUniversalTime(DateTime)
Converts localized time to UTC time as of TimeLocation property
Declaration
public DateTime LocalizedTimeToUniversalTime(DateTime local)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | local |
Returns
Type | Description |
---|---|
System.DateTime |
UniversalTimeToLocalizedTime(DateTime)
Converts universal time to local time as of TimeLocation property
Declaration
public DateTime UniversalTimeToLocalizedTime(DateTime utc)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | utc |
Returns
Type | Description |
---|---|
System.DateTime |
Implements
System.IDisposable