Table of Contents

Struct MinuteSecond

Namespace
Garyon.Objects
Assembly
Garyon.dll

Represents a time instance with the minute and second.

public struct MinuteSecond : IEquatable<MinuteSecond>, IHasMinute, IHasSecond, ITimeObject
Implements
Inherited Members
Extension Methods

Constructors

MinuteSecond(int)

Initializes a new instance of the MinuteSecond struct from the total seconds of the time.

public MinuteSecond(int totalSeconds)

Parameters

totalSeconds int

The total seconds of the time.

MinuteSecond(int, int)

Initializes a new instance of the MinuteSecond struct from the minute and the second of the time.

public MinuteSecond(int minute, int second)

Parameters

minute int

The minute of the time.

second int

The second of the time.

Fields

SecondsPerHour

public const int SecondsPerHour = 3600

Field Value

int

Properties

Minute

Gets or sets the minute.

public int Minute { readonly get; set; }

Property Value

int

NextMinute

Gets the MinuteSecond representation of the next minute from the current time.

public static MinuteSecond NextMinute { get; }

Property Value

MinuteSecond

NextSecond

Gets the MinuteSecond representation of the next second from the current time.

public static MinuteSecond NextSecond { get; }

Property Value

MinuteSecond

Now

Gets the current time's MinuteSecond representation.

public static MinuteSecond Now { get; }

Property Value

MinuteSecond

Second

Gets or sets the second.

public int Second { readonly get; set; }

Property Value

int

TotalHours

Gets or sets the total hours as a double.

public double TotalHours { readonly get; set; }

Property Value

double

TotalMinutes

Gets or sets the total minutes as a double.

public double TotalMinutes { readonly get; set; }

Property Value

double

TotalSeconds

Gets the total seconds.

public int TotalSeconds { readonly get; set; }

Property Value

int

Methods

Add(int)

Adds a number of seconds to the time of this instance.

public void Add(int seconds)

Parameters

seconds int

The seconds to add.

Add(int, int)

Adds a number of seconds to the time of this instance.

public void Add(int minutes, int seconds)

Parameters

minutes int

The minutes to add.

seconds int

The seconds to add.

Equals(MinuteSecond)

Determines whether another MinuteSecond instance is equal to this one.

public readonly bool Equals(MinuteSecond other)

Parameters

other MinuteSecond

The other MinuteSecond instance.

Returns

bool

A value determining whether both objects are equal or not.

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.

Parse(string)

Parses the given string representation of an minute-second time into a MinuteSecond instance.

public static MinuteSecond Parse(string s)

Parameters

s string

The string representation of an minute-second of the form "MM:SS". The string may contain additional numbers split with ":", which will be ignored.

Returns

MinuteSecond

The parsed MinuteSecond instance.

Subtract(int)

Subtracts a number of seconds from the time of this instance.

public void Subtract(int seconds)

Parameters

seconds int

The seconds to subtract.

Subtract(int, int)

Subtracts a number of seconds from the time of this instance.

public void Subtract(int minutes, int seconds)

Parameters

minutes int

The minutes to subtract.

seconds int

The seconds to subtract.

ToString()

Gets the string representation of the minute-second time.

public override readonly string ToString()

Returns

string

The string representation of the minute-second time in the form "MM:SS".

Operators

operator +(MinuteSecond, MinuteSecond)

public static MinuteSecond operator +(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

MinuteSecond

operator +(MinuteSecond, int)

public static MinuteSecond operator +(MinuteSecond hm, int seconds)

Parameters

hm MinuteSecond
seconds int

Returns

MinuteSecond

operator ==(MinuteSecond, MinuteSecond)

public static bool operator ==(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

bool

explicit operator MinuteSecond(DateTime)

public static explicit operator MinuteSecond(DateTime t)

Parameters

t DateTime

Returns

MinuteSecond

explicit operator MinuteSecond(DateTimeOffset)

public static explicit operator MinuteSecond(DateTimeOffset t)

Parameters

t DateTimeOffset

Returns

MinuteSecond

explicit operator MinuteSecond(TimeSpan)

public static explicit operator MinuteSecond(TimeSpan t)

Parameters

t TimeSpan

Returns

MinuteSecond

operator >(MinuteSecond, MinuteSecond)

public static bool operator >(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

bool

operator >=(MinuteSecond, MinuteSecond)

public static bool operator >=(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

bool

implicit operator DateTime(MinuteSecond)

public static implicit operator DateTime(MinuteSecond t)

Parameters

t MinuteSecond

Returns

DateTime

implicit operator DateTimeOffset(MinuteSecond)

public static implicit operator DateTimeOffset(MinuteSecond t)

Parameters

t MinuteSecond

Returns

DateTimeOffset

implicit operator TimeSpan(MinuteSecond)

public static implicit operator TimeSpan(MinuteSecond t)

Parameters

t MinuteSecond

Returns

TimeSpan

operator !=(MinuteSecond, MinuteSecond)

public static bool operator !=(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

bool

operator <(MinuteSecond, MinuteSecond)

public static bool operator <(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

bool

operator <=(MinuteSecond, MinuteSecond)

public static bool operator <=(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

bool

operator -(MinuteSecond, MinuteSecond)

public static MinuteSecond operator -(MinuteSecond left, MinuteSecond right)

Parameters

left MinuteSecond
right MinuteSecond

Returns

MinuteSecond

operator -(MinuteSecond, int)

public static MinuteSecond operator -(MinuteSecond hm, int seconds)

Parameters

hm MinuteSecond
seconds int

Returns

MinuteSecond