Struct MinuteSecond
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
totalSecondsintThe 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
Fields
SecondsPerHour
public const int SecondsPerHour = 3600
Field Value
Properties
Minute
Gets or sets the minute.
public int Minute { readonly get; set; }
Property Value
NextMinute
Gets the MinuteSecond representation of the next minute from the current time.
public static MinuteSecond NextMinute { get; }
Property Value
NextSecond
Gets the MinuteSecond representation of the next second from the current time.
public static MinuteSecond NextSecond { get; }
Property Value
Now
Gets the current time's MinuteSecond representation.
public static MinuteSecond Now { get; }
Property Value
Second
Gets or sets the second.
public int Second { readonly get; set; }
Property Value
TotalHours
Gets or sets the total hours as a double.
public double TotalHours { readonly get; set; }
Property Value
TotalMinutes
Gets or sets the total minutes as a double.
public double TotalMinutes { readonly get; set; }
Property Value
TotalSeconds
Gets the total seconds.
public int TotalSeconds { readonly get; set; }
Property Value
Methods
Add(int)
Adds a number of seconds to the time of this instance.
public void Add(int seconds)
Parameters
secondsintThe 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
Equals(MinuteSecond)
Determines whether another MinuteSecond instance is equal to this one.
public readonly bool Equals(MinuteSecond other)
Parameters
otherMinuteSecondThe 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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
sstringThe 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
secondsintThe 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
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
leftMinuteSecondrightMinuteSecond
Returns
operator +(MinuteSecond, int)
public static MinuteSecond operator +(MinuteSecond hm, int seconds)
Parameters
hmMinuteSecondsecondsint
Returns
operator ==(MinuteSecond, MinuteSecond)
public static bool operator ==(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
explicit operator MinuteSecond(DateTime)
public static explicit operator MinuteSecond(DateTime t)
Parameters
tDateTime
Returns
explicit operator MinuteSecond(DateTimeOffset)
public static explicit operator MinuteSecond(DateTimeOffset t)
Parameters
Returns
explicit operator MinuteSecond(TimeSpan)
public static explicit operator MinuteSecond(TimeSpan t)
Parameters
tTimeSpan
Returns
operator >(MinuteSecond, MinuteSecond)
public static bool operator >(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
operator >=(MinuteSecond, MinuteSecond)
public static bool operator >=(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
implicit operator DateTime(MinuteSecond)
public static implicit operator DateTime(MinuteSecond t)
Parameters
Returns
implicit operator DateTimeOffset(MinuteSecond)
public static implicit operator DateTimeOffset(MinuteSecond t)
Parameters
Returns
implicit operator TimeSpan(MinuteSecond)
public static implicit operator TimeSpan(MinuteSecond t)
Parameters
Returns
operator !=(MinuteSecond, MinuteSecond)
public static bool operator !=(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
operator <(MinuteSecond, MinuteSecond)
public static bool operator <(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
operator <=(MinuteSecond, MinuteSecond)
public static bool operator <=(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
operator -(MinuteSecond, MinuteSecond)
public static MinuteSecond operator -(MinuteSecond left, MinuteSecond right)
Parameters
leftMinuteSecondrightMinuteSecond
Returns
operator -(MinuteSecond, int)
public static MinuteSecond operator -(MinuteSecond hm, int seconds)
Parameters
hmMinuteSecondsecondsint