TimeUtils.GetFirstDayOfWeek method
Version 1.1.28
.NET Framework 4.8
Namespace | Skybrud.Essentials.Time |
---|---|
Assembly | Skybrud.Essentials.dll |
GetFirstDayOfWeek(DateTime)
Static
Gets the first day of the week of the specified date
. Monday is considered the first day of
the week.
public static DateTime GetFirstDayOfWeek(DateTime date)
Parameters
date
DateTime
The date.
GetFirstDayOfWeek(DateTimeOffset)
Static
Gets the first day of the week of the specified date
. Monday is considered the first day of
the week.
public static DateTimeOffset GetFirstDayOfWeek(DateTimeOffset date)
Parameters
date
DateTimeOffset
The date.
Returns
An instance of DateTimeOffset representing the first day of the week.
GetFirstDayOfWeek(DateTime, DayOfWeek)
Static
Gets the first day of the week of the specified date
and based on startOfWeek
.
public static DateTime GetFirstDayOfWeek(DateTime date, DayOfWeek startOfWeek)
GetFirstDayOfWeek(DateTimeOffset, DayOfWeek)
Static
Gets the first day of the week of the specified date
and based on startOfWeek
.
public static DateTimeOffset GetFirstDayOfWeek(DateTimeOffset date, DayOfWeek startOfWeek)
Parameters
date
DateTimeOffset
The date.
startOfWeek
DayOfWeek
The first day of the week (eg. System.DayOfWeek.Monday
or
System.DayOfWeek.Sunday
).
Returns
An instance of DateTimeOffset representing the first day of the week.