Coree.NETStandard
  • API
Show / Hide Table of Contents
  • Coree.NETStandard.Abstractions.DependencySingleton
    • DependencySingleton<T>
    • IDependencySingleton
  • Coree.NETStandard.Abstractions.FluentBase
    • FluentBase
    • IFluentBase
  • Coree.NETStandard.Abstractions.InitializationService
    • InitializationDependentServices
    • InitializationService
  • Coree.NETStandard.Abstractions.ServiceFactory
    • ServiceFactory<T>
  • Coree.NETStandard.Abstractions.ServiceFactoryEx
    • ServiceFactoryEx<T>
    • ServiceFactoryEx<T, K, R, S, U, V, W, X, Y, Z>
    • ServiceFactoryEx<T, K>
    • ServiceFactoryEx<T, K, R>
    • ServiceFactoryEx<T, K, R, S>
    • ServiceFactoryEx<T, K, R, S, U>
    • ServiceFactoryEx<T, K, R, S, U, V>
    • ServiceFactoryEx<T, K, R, S, U, V, W>
    • ServiceFactoryEx<T, K, R, S, U, V, W, X>
    • ServiceFactoryEx<T, K, R, S, U, V, W, X, Y>
  • Coree.NETStandard.Classes.AsyncEventCollection
    • AsyncEventCollection<T>
    • AsyncEventCollection<T>.CustomEventDelegate
  • Coree.NETStandard.Classes.CommonDistinguishedNameBuilder
    • CommonDistinguishedNameBuilder
    • DistinguishedName
  • Coree.NETStandard.Classes.Criteria
    • CriteriaComparisonMethod
    • CriteriaEnumerableExtensions
    • CriteriaExpressionBuilder
    • CriteriaItem<TValue>
    • CriteriaItems
    • CriteriaOperator
    • CriteriaQueryableExtensions
  • Coree.NETStandard.Classes.HttpRequestService
    • ContentComposer
    • HttpRequestHeadersExtensions
    • HttpRequestService
    • HttpRequestServiceHandler
    • HttpRequestServiceUriExtensions
    • ServiceCollectionExtensions
    • TransactionRecord
  • Coree.NETStandard.Classes.Scheduler
    • Scheduler
    • Scheduler.TickerEventArgs
    • Scheduler.TickerEventDelegate
  • Coree.NETStandard.Classes.ThreadSafeCollection
    • ThreadSafeCollection<T>
  • Coree.NETStandard.Classes.ThreadSafeValue
    • ThreadSafeValue<T>
  • Coree.NETStandard.Classes.TimeOfDay
    • TimeOfDay
  • Coree.NETStandard.Extensions.Collections.Enumerable
    • CollectionsEnumerableExtensions
  • Coree.NETStandard.Extensions.Collections.List
    • CollectionsListExtensions
  • Coree.NETStandard.Extensions.Conversions.ByteArray
    • ConversionsByteArrayExtensions
  • Coree.NETStandard.Extensions.Conversions.HostApplicationBuilder
    • ConversionsHostApplicationBuilderExtensions
  • Coree.NETStandard.Extensions.Conversions.String
    • ConversionsStringExtensions
    • Encodings
  • Coree.NETStandard.Extensions.Conversions.Stringbuilder
    • ConversionsStringbuilderExtension
  • Coree.NETStandard.Extensions.Enums
    • EnumExtensions
  • Coree.NETStandard.Extensions.Http.HttpHeader
    • HttpHeadersExtensions
  • Coree.NETStandard.Extensions.Primitives.Bool
    • PrimitivesBoolExtensions
  • Coree.NETStandard.Extensions.Reflection.ServiceProvider
    • ReflectionServiceProviderExtensions
  • Coree.NETStandard.Extensions.ServiceCollection
    • ServiceCollectionExtensions
  • Coree.NETStandard.Extensions.Threading.CancellationToken
    • ThreadingCancellationTokenExtensions
  • Coree.NETStandard.Extensions.Utilities
    • DateTimeExtensions
  • Coree.NETStandard.Extensions.Validations.String
    • ValidationsStringExtensions
  • Coree.NETStandard.HostedServicesCollection
    • HostedServicesCollectionConfig<T>
    • IHostedServicesCollectionConfig<T>
    • ServiceCollectionExtensions
    • ServiceProviderExtensions
  • Coree.NETStandard.Serilog
    • ConditionalLevelSink
    • CustomTheme
    • LoggerSinkConfigurationExtensions
    • OutputTemplates
    • ServiceCollectionExtensions
    • SourceContextShortEnricher
  • Coree.NETStandard.Services.DebugManagement
    • DebugService
    • IDebugService
  • Coree.NETStandard.Services.DirectoryOperationsManagement
    • DirectoryOperationsService
    • IDirectoryOperationsService
  • Coree.NETStandard.Services.FileManagement
    • FileService
    • IFileService
  • Coree.NETStandard.Services.FileOperationsManagement
    • FileOperationsService
    • FileOperationsService.FileSystemEntry
    • FileOperationsService.FileSystemInformation
    • FileOperationsService.VerifiedCopyStatus
    • IFileOperationsService
  • Coree.NETStandard.Services.HashManagement
    • HashService
    • IHashService
  • Coree.NETStandard.Services.NetworkManagement
    • INetworkService
    • NetworkService
    • NetworkService.IpAdressInformation
    • NetworkService.NetworkInterfaceDetail
  • Coree.NETStandard.Services.ProcessManagement
    • IProcessService
    • ProcessRunExitCodeState
    • ProcessRunResult
    • ProcessService
  • Coree.NETStandard.Services.RuntimeInsightsManagement
    • IRuntimeInsightsService
    • RuntimeInsightsService
  • Coree.NETStandard.SpectreConsole
    • CommandAppExtensions
    • HostBuilderExtensions
    • ServiceCollectionExtensions
    • SpectreConsoleHostedService
    • SpectreConsoleHostedService.ExitCode
    • SpectreConsoleTypeRegistrar
    • SpectreConsoleTypeResolver
  • Coree.NETStandard.UnderConstruction
    • DbContextExtensions
    • HttpClientStatic
    • HttpClientStatic.HttpClientResponse
    • HttpClientStatic.XRate
    • HttpClientStatic.XRateGroup
    • HttpClientStatic.XRateItem
    • IScheduleProvider
    • IntervalScheduleProvider
    • LimitedHistory<T>
    • ScheduleCombiner
    • Scheduler
    • Scheduler.TickerEventArgs
    • Scheduler.TickerEventDelegate
    • Scheduler2
    • Scheduler2.TickerEventArgs
    • Scheduler2.TickerEventDelegate
    • Scheduler3
    • Scheduler3.TickerEventArgs
    • Scheduler3.TickerEventDelegate
    • SqlliteMemoryContext
    • SqlliteMemoryContext.UserDataDto
    • TimedEntry<T>
    • Timing
    • Timing.Ticker
    • Timing.Ticker.TickerEventArgs
    • Timing.TickerSync
    • WeekDayAtScheduleProvider
  • Coree.NETStandard.Utilities
    • EventSubscription
    • MainContext

Class TimeOfDay

Represents a specific time of day, independent of any date.

Inheritance
object
TimeOfDay
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Coree.NETStandard.Classes.TimeOfDay
Assembly: Coree.NETStandard.dll
Syntax
public class TimeOfDay

Constructors

| Edit this page View Source

TimeOfDay(int, int, int, int)

Initializes a new instance of the TimeOfDay class to a specified number of hours, minutes, seconds, and milliseconds.

Declaration
public TimeOfDay(int hour = 0, int minute = 0, int second = 0, int millisecond = 0)
Parameters
Type Name Description
int hour

The hour component of the time.

int minute

The minute component of the time.

int second

The second component of the time.

int millisecond

The millisecond component of the time.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the specified time components are out of their expected range.

Properties

| Edit this page View Source

Hour

Gets the hour component of the time.

Declaration
public int Hour { get; }
Property Value
Type Description
int
| Edit this page View Source

Millisecond

Gets the millisecond component of the time.

Declaration
public int Millisecond { get; }
Property Value
Type Description
int
| Edit this page View Source

Minute

Gets the minute component of the time.

Declaration
public int Minute { get; }
Property Value
Type Description
int
| Edit this page View Source

Second

Gets the second component of the time.

Declaration
public int Second { get; }
Property Value
Type Description
int
| Edit this page View Source

Ticks

Gets the number of ticks that represent the time.

Declaration
public long Ticks { get; }
Property Value
Type Description
long

Methods

| Edit this page View Source

Add(TimeSpan)

Adds a TimeSpan to this TimeOfDay instance.

Declaration
public TimeOfDay Add(TimeSpan duration)
Parameters
Type Name Description
TimeSpan duration

The TimeSpan to add.

Returns
Type Description
TimeOfDay

A new TimeOfDay instance representing the added time.

| Edit this page View Source

AddHours(double)

Adds a specified number of hours to this TimeOfDay instance.

Declaration
public TimeOfDay AddHours(double duration)
Parameters
Type Name Description
double duration

The number of hours to add.

Returns
Type Description
TimeOfDay

A new TimeOfDay instance representing the added time.

| Edit this page View Source

AddMinutes(double)

Adds a specified number of minutes to this TimeOfDay instance.

Declaration
public TimeOfDay AddMinutes(double duration)
Parameters
Type Name Description
double duration

The number of minutes to add.

Returns
Type Description
TimeOfDay

A new TimeOfDay instance representing the added time.

| Edit this page View Source

AddSeconds(double)

Adds a specified number of seconds to this TimeOfDay instance.

Declaration
public TimeOfDay AddSeconds(double duration)
Parameters
Type Name Description
double duration

The number of seconds to add.

Returns
Type Description
TimeOfDay

A new TimeOfDay instance representing the added time.

| Edit this page View Source

FromTime(int, int, int, int)

Creates a TimeOfDay from individual time components.

Declaration
public static TimeOfDay FromTime(int hours = 0, int minutes = 0, int seconds = 0, int milliseconds = 0)
Parameters
Type Name Description
int hours

Hour component.

int minutes

Minute component.

int seconds

Second component.

int milliseconds

Millisecond component.

Returns
Type Description
TimeOfDay

A new TimeOfDay instance.

| Edit this page View Source

FromTimeSpan(TimeSpan)

Creates a TimeOfDay from a TimeSpan object.

Declaration
public static TimeOfDay FromTimeSpan(TimeSpan time)
Parameters
Type Name Description
TimeSpan time

The TimeSpan object to convert.

Returns
Type Description
TimeOfDay

A TimeOfDay object.

| Edit this page View Source

FromTimeString(string)

Converts a string representation of a time into a TimeOfDay object.

Declaration
public static TimeOfDay FromTimeString(string timeString)
Parameters
Type Name Description
string timeString

A string that represents the time in "hh:mm:ss" format.

Returns
Type Description
TimeOfDay

A TimeOfDay object.

Exceptions
Type Condition
FormatException

Thrown when the time string is not in a valid format.

| Edit this page View Source

Subtract(TimeSpan)

Subtracts a TimeSpan from this TimeOfDay instance.

Declaration
public TimeOfDay Subtract(TimeSpan duration)
Parameters
Type Name Description
TimeSpan duration

The TimeSpan to subtract.

Returns
Type Description
TimeOfDay

A new TimeOfDay instance representing the subtracted time.

| Edit this page View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object in "hh:mm:ss" format.

Overrides
object.ToString()
| Edit this page View Source

ToTimeSpan()

Converts this TimeOfDay instance to a TimeSpan.

Declaration
public TimeSpan ToTimeSpan()
Returns
Type Description
TimeSpan

A TimeSpan that represents the time.

Operators

| Edit this page View Source

implicit operator TimeOfDay(string)

Defines an implicit conversion of a string to a TimeOfDay.

Declaration
public static implicit operator TimeOfDay(string timeString)
Parameters
Type Name Description
string timeString

The string to convert to TimeOfDay.

Returns
Type Description
TimeOfDay

A TimeOfDay equivalent to the time contained in the string.

  • Edit this page
  • View Source
In this article
Back to top