Table of Contents

Class CoordinatedUniversalTime

Namespace
Codebelt.SharedKernel
Assembly
Codebelt.SharedKernel.dll

Represents a CoordinatedUniversalTime (UTC) object that can be used when you need a timestamp that is based on an absolute time.

public class CoordinatedUniversalTime : ComparableValueObject<DateTime>, IEquatable<ValueObject>, IEquatable<SingleValueObject<DateTime>>, IComparisonOperators<ComparableValueObject<DateTime>, ComparableValueObject<DateTime>, bool>, IEqualityOperators<ComparableValueObject<DateTime>, ComparableValueObject<DateTime>, bool>, IEquatable<ComparableValueObject<DateTime>>, IEquatable<CoordinatedUniversalTime>
Inheritance
Object
CoordinatedUniversalTime
Implements
IEquatable<ValueObject>
IEquatable<SingleValueObject<DateTime>>
IComparisonOperators<ComparableValueObject<DateTime>, ComparableValueObject<DateTime>, Boolean>
IEqualityOperators<ComparableValueObject<DateTime>, ComparableValueObject<DateTime>, Boolean>
IEquatable<ComparableValueObject<DateTime>>
Inherited Members
SingleValueObject<DateTime>.PrintMembers(StringBuilder)
SingleValueObject<DateTime>.GetHashCode()
SingleValueObject<DateTime>.Equals(Object)
SingleValueObject<DateTime>.Equals(ValueObject)
SingleValueObject<DateTime>.Equals(SingleValueObject<DateTime>)
SingleValueObject<DateTime>.<Clone>$()
SingleValueObject<DateTime>.EqualityContract

Remarks

Constructors

CoordinatedUniversalTime(DateTime)

Initializes a new instance of the CoordinatedUniversalTime class.

public CoordinatedUniversalTime(DateTime value)

Parameters

value DateTime

The System.DateTime value to assign the role of CoordinatedUniversalTime.

Exceptions

System.ArgumentException

value is not in a valid state, e.g., it's different from System.DateTimeKind.Utc.

Fields

MaxValue

Denotes the largest possible value of CoordinatedUniversalTime.

public static readonly CoordinatedUniversalTime MaxValue

Field Value

CoordinatedUniversalTime

MinValue

Denotes the smallest possible value of CoordinatedUniversalTime.

public static readonly CoordinatedUniversalTime MinValue

Field Value

CoordinatedUniversalTime

Methods

FromString(String)

Converts the string representation of a date and time to its CoordinatedUniversalTime> equivalent.

public static CoordinatedUniversalTime FromString(string value)

Parameters

value String

A string that contains a date and time to convert.

Returns

CoordinatedUniversalTime

A new instance of CoordinatedUniversalTime that represents value.

Now()

Returns a CoordinatedUniversalTime whose value is the current UTC date and time.

public static CoordinatedUniversalTime Now()

Returns

CoordinatedUniversalTime

A new instance of CoordinatedUniversalTime set to the current date and time on this computer.

ToString()

Returns a System.String> that represents this instance and complies with ISO 8601.

public override string ToString()

Returns

String

A System.String> that represents this instance and complies with ISO 8601.

Operators

Implicit(CoordinatedUniversalTime to DateTime)

Performs an implicit conversion from CoordinatedUniversalTime to System.DateTime.

public static implicit operator DateTime(CoordinatedUniversalTime value)

Parameters

value CoordinatedUniversalTime

The value to convert.

Returns

DateTime

A System.DateTime that is equivalent to value.

Implicit(DateTime to CoordinatedUniversalTime)

Performs an implicit conversion from System.DateTime to CoordinatedUniversalTime.

public static implicit operator CoordinatedUniversalTime(DateTime value)

Parameters

value DateTime

The value to convert.

Returns

CoordinatedUniversalTime

A CoordinatedUniversalTime that is equivalent to value.

Implicit(DateTimeOffset to CoordinatedUniversalTime)

Performs an implicit conversion from System.DateTimeOffset to CoordinatedUniversalTime.

public static implicit operator CoordinatedUniversalTime(DateTimeOffset value)

Parameters

value DateTimeOffset

The value to convert.

Returns

CoordinatedUniversalTime

A CoordinatedUniversalTime that is equivalent to value.

See Also