Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 6.94 KB

Assorted.Utils.Dates.DateTimeExtensions.md

File metadata and controls

57 lines (45 loc) · 6.94 KB

DateTimeExtensions Class

Namespace: Assorted.Utils.Dates
Assembly: Assorted.Utils (Assorted.Utils.dll) version 1.1.0.0
Inheritance: object DateTimeExtensions

Extends the System.DateTime type.

Syntax

public static class DateTimeExtensions

Methods

Method Description
DayOfWeekInstance(this DateTime) Returns on which week of the month the day of the week appears.
DaysFromStartOfTheWeek(this DateTime, DayOfWeek) Returns the number of days between this date and start of the week.
DaysInMonth(this DateTime) Returns the number of days in the month given by the value of this instance.
DaysInYear(this DateTime) Returns the number of days in the year given by the value of this instance.
EndOfDay(this DateTime) Returns a System.DateTime value that represents the last moment of the day.
EndOfHour(this DateTime) Returns a System.DateTime value that represents the last moment of the hour.
EndOfMillisecond(this DateTime) Returns a System.DateTime value that represents the last moment of the millisecond.
EndOfMinute(this DateTime) Returns a System.DateTime value that represents the last moment of the minute.
EndOfMonth(this DateTime) Returns a System.DateTime value that represents the last moment of the month.
EndOfSecond(this DateTime) Returns a System.DateTime value that represents the last moment of the second.
EndOfWeek(this DateTime, DayOfWeek) Returns a System.DateTime value that represents the last moment of the week.
EndOfYear(this DateTime) Returns a System.DateTime value that represents the last moment of the year.
FormatIso8601(this DateTime) Returns the string representation of the date in ISO-8601 format.
IsInLeapYear(this DateTime) Indicates whether the System.DateTime value is in a leap year.
ReplaceDate(this DateTime, DateTime) Returns a System.DateTime value with a new System.DateTime.Date while preserving the original System.DateTime.TimeOfDay and System.DateTime.Kind values.
ReplaceTime(this DateTime, TimeSpan) Returns a System.DateTime value with a new System.DateTime.TimeOfDay while preserving the original System.DateTime.Date and System.DateTime.Kind values.
StartOfDay(this DateTime) Returns a System.DateTime value that represents the first moment of the day.
StartOfHour(this DateTime) Returns a System.DateTime value that represents the first moment of the hour.
StartOfMillisecond(this DateTime) Returns a System.DateTime value that represents the first moment of the millisecond.
StartOfMinute(this DateTime) Returns a System.DateTime value that represents the first moment of the minute.
StartOfMonth(this DateTime) Returns a System.DateTime value that represents the first moment of the month.
StartOfSecond(this DateTime) Returns a System.DateTime value that represents the first moment of the second.
StartOfWeek(this DateTime, DayOfWeek) Returns a System.DateTime value that represents the first moment of the week.
StartOfYear(this DateTime) Returns a System.DateTime value that represents the first moment of the year.
ToIso8601(this DateTime) Returns ISO-8601 year, week of the year and day of the week.
WeekOfMonth(this DateTime, DayOfWeek) Returns the week number within the month.
WeeksInYear(this DateTime) Returns the number of ISO-8601 weeks in the year given by the value of this instance.

Thread Safety

Any public static member of this type is thread-safe, but instance members are not guaranteed to be thread-safe.

See Also


This document is generated by DG.