Struct MonthStamp
Use this class to specify a particular month in the Gregorian calendar.
Its intent to to be very clear that it is a MONTH, and not a moment in time,
and to properly serialize and deserialize as such without the influence of timezone conversions.
Assembly: FFT.TimeStamps.dll
Syntax
public struct MonthStamp : IEquatable<MonthStamp>, IComparable<MonthStamp>
Constructors
|
Improve this Doc
View Source
MonthStamp(Int32, Int32)
Initializes a new instance of the MonthStamp struct.
Declaration
public MonthStamp(int year, int month)
Parameters
Type |
Name |
Description |
System.Int32 |
year |
|
System.Int32 |
month |
|
Fields
|
Improve this Doc
View Source
DateTime
A DateTime set at exactly midnight of the first day of the month represented by this MonthStamp.
Its property is set equal to .
Declaration
public readonly DateTime DateTime
Field Value
Type |
Description |
DateTime |
|
|
Improve this Doc
View Source
MaxValue
Declaration
public static readonly MonthStamp MaxValue
Field Value
|
Improve this Doc
View Source
MinValue
Declaration
public static readonly MonthStamp MinValue
Field Value
Properties
|
Improve this Doc
View Source
Month
Gets the month component of the current value.
Declaration
public int Month { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
UtcThisMonth
Gets the current month in Utc timezone.
Declaration
public static MonthStamp UtcThisMonth { get; }
Property Value
|
Improve this Doc
View Source
Year
Gets the year component of the current value.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
AddMonths(Int32)
Adds the given number of months to the current value and returns the result.
Declaration
public MonthStamp AddMonths(int numMonths)
Parameters
Type |
Name |
Description |
System.Int32 |
numMonths |
The number of months to add. Can be negative.
|
Returns
|
Improve this Doc
View Source
AddYears(Int32)
Adds the given number of months to the current value and returns the result.
Declaration
public MonthStamp AddYears(int numYears)
Parameters
Type |
Name |
Description |
System.Int32 |
numYears |
The number of years to add. Can be negative.
|
Returns
|
Improve this Doc
View Source
CompareTo(MonthStamp)
Declaration
public int CompareTo(MonthStamp other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CreateFrom(DateTime)
Creates a MonthStamp from the given month
parameter.
month
must be a DateTime with
a) equal to ,
b) equal to 1,
c) equal to .
Declaration
public static MonthStamp CreateFrom(DateTime month)
Parameters
Type |
Name |
Description |
DateTime |
month |
|
Returns
|
Improve this Doc
View Source
Equals(MonthStamp)
Declaration
public bool Equals(MonthStamp other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
FromString(ReadOnlySpan<Char>)
Declaration
public static MonthStamp FromString(ReadOnlySpan<char> value)
Parameters
Type |
Name |
Description |
ReadOnlySpan<System.Char> |
value |
|
Returns
|
Improve this Doc
View Source
FromString(String)
Parses a DateStamp from the format 'yyyy-MM-dd'.
Declaration
public static MonthStamp FromString(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetMonthsSince(MonthStamp)
Calculates the difference, in months, between the current value and other
.
Declaration
public int GetMonthsSince(MonthStamp other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetMonthsUntil(MonthStamp)
Calculates the difference, in months, between the current value and other
.
Declaration
public int GetMonthsUntil(MonthStamp other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Max(MonthStamp, MonthStamp)
Returns the maximum of the given values.
Declaration
public static MonthStamp Max(MonthStamp m1, MonthStamp m2)
Parameters
Returns
|
Improve this Doc
View Source
Max(MonthStamp[])
Returns the maximum of the given values.
Declaration
public static MonthStamp Max(params MonthStamp[] values)
Parameters
Returns
|
Improve this Doc
View Source
Min(MonthStamp, MonthStamp)
Returns the minimum of the given values.
Declaration
public static MonthStamp Min(MonthStamp m1, MonthStamp m2)
Parameters
Returns
|
Improve this Doc
View Source
Min(MonthStamp[])
Returns the minimum of the given values.
Declaration
public static MonthStamp Min(params MonthStamp[] values)
Parameters
Returns
|
Improve this Doc
View Source
OrValueIfGreater(MonthStamp)
Returns the greater of the two monthstamps.
Declaration
public MonthStamp OrValueIfGreater(MonthStamp d)
Parameters
Returns
|
Improve this Doc
View Source
OrValueIfLesser(MonthStamp)
Returns the lesser of the two monthstamps.
Declaration
public MonthStamp OrValueIfLesser(MonthStamp d)
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Gets a string representation of the current value in the format yyyy-MM.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Operators
|
Improve this Doc
View Source
Equality(MonthStamp, MonthStamp)
Declaration
public static bool operator ==(MonthStamp left, MonthStamp right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThan(MonthStamp, MonthStamp)
Declaration
public static bool operator>(MonthStamp left, MonthStamp right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThanOrEqual(MonthStamp, MonthStamp)
Declaration
public static bool operator >=(MonthStamp left, MonthStamp right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(MonthStamp, MonthStamp)
Declaration
public static bool operator !=(MonthStamp left, MonthStamp right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThan(MonthStamp, MonthStamp)
Declaration
public static bool operator <(MonthStamp left, MonthStamp right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThanOrEqual(MonthStamp, MonthStamp)
Declaration
public static bool operator <=(MonthStamp left, MonthStamp right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
IEquatable<>
IComparable<>