Struct TimeOfWeek
Expresses a day and time as a point in the week.
Comparison operators assume the beginning of the week is midnight, Sunday.
Assembly: FFT.TimeStamps.dll
Syntax
public struct TimeOfWeek : IEquatable<TimeOfWeek>, IComparable<TimeOfWeek>
Constructors
|
Improve this Doc
View Source
TimeOfWeek(DayOfWeek, TimeSpan)
Initializes a new instance of the TimeOfWeek struct.
Declaration
public TimeOfWeek(DayOfWeek dayOfWeek, TimeSpan timeOfDay)
Parameters
Type |
Name |
Description |
DayOfWeek |
dayOfWeek |
The day of week for this value.
|
TimeSpan |
timeOfDay |
The tine of day for this value.
|
|
Improve this Doc
View Source
TimeOfWeek(Int64)
Initializes a new instance of the TimeOfWeek struct.
Declaration
public TimeOfWeek(long ticksSinceWeekFloor)
Parameters
Type |
Name |
Description |
System.Int64 |
ticksSinceWeekFloor |
The number of ticks (ten-millionths of a second) since midnight, Sunday.
|
Properties
|
Improve this Doc
View Source
DayOfWeek
Gets the day of week component of the current value.
Declaration
public DayOfWeek DayOfWeek { get; }
Property Value
Type |
Description |
DayOfWeek |
|
|
Improve this Doc
View Source
EndOfWeek
Special value that represents the end of the week, or the beginning of the next week.
Declaration
public static TimeOfWeek EndOfWeek { get; }
Property Value
|
Improve this Doc
View Source
IsEndOfWeek
Returns true if this value is equal to the special EndOfWeek value.
Declaration
public bool IsEndOfWeek { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TicksSinceWeekFloor
The number of ticks (ten-millionths of a second) that have elapsed since the beginning of the week, midnight Sunday.
Declaration
public long TicksSinceWeekFloor { get; }
Property Value
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
TimeOfDay
Gets the time of day component of the current value.
Declaration
public TimeSpan TimeOfDay { get; }
Property Value
Type |
Description |
TimeSpan |
|
Methods
|
Improve this Doc
View Source
Add(TimeSpan)
Adds the given amount of time to the TimeOfWeek and returns the new TimeOfWeek.
The result wraps around the end of the week back to the beginning, so the result of an add operation could
be "less than" the original value. You can add positive or negative time values. Negative time values will
also "wrap backwards" around the week.
The result will always be less than EndOfWeek.
Declaration
public TimeOfWeek Add(TimeSpan time)
Parameters
Type |
Name |
Description |
TimeSpan |
time |
|
Returns
|
Improve this Doc
View Source
CompareTo(TimeOfWeek)
Declaration
public int CompareTo(TimeOfWeek other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CreateFrom(DateTime)
Declaration
public static TimeOfWeek CreateFrom(DateTime dateTime)
Parameters
Type |
Name |
Description |
DateTime |
dateTime |
|
Returns
|
Improve this Doc
View Source
Equals(TimeOfWeek)
Declaration
public bool Equals(TimeOfWeek 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(String)
Parses the given value
to create the TimeOfWeek it represents.
Valid inputs are any string output by ToString().
Declaration
public static TimeOfWeek 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
ToString()
Returns a string in the format $"{DayOfWeek} {TimeOfDay:c}"
If the value is EndOfWeek, the string "EndOfWeek" is returned.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
ToString(String)
Returns a string in the format $"{DayOfWeek} {TimeOfDay.ToString(timeOfDayFormat)}"
If the value is EndOfWeek, the string "EndOfWeek" is returned.
Declaration
public string ToString(string timeOfDayFormat)
Parameters
Type |
Name |
Description |
System.String |
timeOfDayFormat |
|
Returns
Type |
Description |
System.String |
|
Operators
|
Improve this Doc
View Source
Equality(TimeOfWeek, TimeOfWeek)
Declaration
public static bool operator ==(TimeOfWeek left, TimeOfWeek right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThan(TimeOfWeek, TimeOfWeek)
Declaration
public static bool operator>(TimeOfWeek left, TimeOfWeek right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThanOrEqual(TimeOfWeek, TimeOfWeek)
Declaration
public static bool operator >=(TimeOfWeek left, TimeOfWeek right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(TimeOfWeek, TimeOfWeek)
Declaration
public static bool operator !=(TimeOfWeek left, TimeOfWeek right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThan(TimeOfWeek, TimeOfWeek)
Declaration
public static bool operator <(TimeOfWeek left, TimeOfWeek right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThanOrEqual(TimeOfWeek, TimeOfWeek)
Declaration
public static bool operator <=(TimeOfWeek left, TimeOfWeek right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
IEquatable<>
IComparable<>