Table of Contents

Struct ClockTime

Namespace
Glitch9
[Serializable]
public struct ClockTime : IComparable
Implements
Inherited Members
Extension Methods

Constructors

ClockTime(ClockTime, bool)

public ClockTime(ClockTime clockTime, bool immutable = false)

Parameters

clockTime ClockTime
immutable bool

ClockTime(DateTime, bool)

public ClockTime(DateTime dateTime, bool immutable = false)

Parameters

dateTime DateTime
immutable bool

ClockTime(int, bool)

public ClockTime(int time, bool immutable = false)

Parameters

time int
immutable bool

ClockTime(int, int, bool)

public ClockTime(int hour, int minute, bool immutable = false)

Parameters

hour int
minute int
immutable bool

Fields

Immutable

public bool Immutable

Field Value

bool

Value

public int Value

Field Value

int

Properties

Afternoon

public static ClockTime Afternoon { get; }

Property Value

ClockTime

Dawn

public static ClockTime Dawn { get; }

Property Value

ClockTime

Evening

public static ClockTime Evening { get; }

Property Value

ClockTime

Hour

public int Hour { readonly get; set; }

Property Value

int

Midnight

public static ClockTime Midnight { get; }

Property Value

ClockTime

Minute

public int Minute { readonly get; set; }

Property Value

int

Morning

public static ClockTime Morning { get; }

Property Value

ClockTime

Night

public static ClockTime Night { get; }

Property Value

ClockTime

Noon

public static ClockTime Noon { get; }

Property Value

ClockTime

Now

public static ClockTime Now { get; }

Property Value

ClockTime

TotalMinutes

public readonly int TotalMinutes { get; }

Property Value

int

Zero

public static ClockTime Zero { get; }

Property Value

ClockTime

Methods

AddHours(int)

public ClockTime AddHours(int hours)

Parameters

hours int

Returns

ClockTime

AddMinutes(int)

public ClockTime AddMinutes(int minutes)

Parameters

minutes int

Returns

ClockTime

CompareTo(object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public readonly int CompareTo(object obj)

Parameters

obj object

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes obj in the sort order.
Zero This instance occurs in the same position in the sort order as obj.
Greater than zero This instance follows obj in the sort order.

Exceptions

ArgumentException

obj is not the same type as this instance.

Equals(ClockTime)

public readonly bool Equals(ClockTime other)

Parameters

other ClockTime

Returns

bool

Equals(object)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToDateTime()

public readonly DateTime ToDateTime()

Returns

DateTime

ToServerString()

public readonly string ToServerString()

Returns

string

ToString()

Returns the fully qualified type name of this instance.

public override readonly string ToString()

Returns

string

The fully qualified type name.

ToString(string)

public readonly string ToString(string format)

Parameters

format string

Returns

string

TryParse(string, out ClockTime)

public static bool TryParse(string time, out ClockTime result)

Parameters

time string
result ClockTime

Returns

bool

Operators

operator +(ClockTime, TimeSpan)

public static ClockTime operator +(ClockTime a, TimeSpan b)

Parameters

a ClockTime
b TimeSpan

Returns

ClockTime

operator ==(ClockTime, ClockTime)

public static bool operator ==(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

bool

explicit operator DateTime(ClockTime)

public static explicit operator DateTime(ClockTime time)

Parameters

time ClockTime

Returns

DateTime

operator >(ClockTime, ClockTime)

public static bool operator >(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

bool

operator >=(ClockTime, ClockTime)

public static bool operator >=(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

bool

implicit operator int(ClockTime)

public static implicit operator int(ClockTime time)

Parameters

time ClockTime

Returns

int

implicit operator ClockTime(DateTime)

public static implicit operator ClockTime(DateTime dateTime)

Parameters

dateTime DateTime

Returns

ClockTime

implicit operator ClockTime(int)

public static implicit operator ClockTime(int time)

Parameters

time int

Returns

ClockTime

operator !=(ClockTime, ClockTime)

public static bool operator !=(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

bool

operator <(ClockTime, ClockTime)

public static bool operator <(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

bool

operator <=(ClockTime, ClockTime)

public static bool operator <=(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

bool

operator -(ClockTime, ClockTime)

public static TimeSpan operator -(ClockTime a, ClockTime b)

Parameters

a ClockTime
b ClockTime

Returns

TimeSpan