DateTimeExtensions Class
Provides extension methods for DateTime to perform common date manipulations.
public static class DateTimeExtensionsMethods
| Name | Description |
|---|---|
| EndOfMonth(DateTime) | Returns the last day of the month for the specified date at midnight. |
| StartOfMonth(DateTime) | Returns the first day of the month for the specified date at midnight. |
| StartOfMonth(DateTime, bool) | Returns the first day of the month for the specified date, optionally keeping the time component. |
| StartOfWeek(DateTime) | Returns the start of the week for the specified date using the current culture's first day of week. |
| StartOfWeek(DateTime, DayOfWeek) | Returns the start of the week for the specified date using the specified first day of week. |
| StartOfYear(DateTime) | Returns the first day of the year for the specified date at midnight. |
| StartOfYear(DateTime, bool) | Returns the first day of the year for the specified date, optionally keeping the time component. |
| ToStringInvariant(DateOnly) | |
| ToStringInvariant(DateOnly, string) | |
| ToStringInvariant(DateTime) | |
| ToStringInvariant(DateTime, string) | |
| ToStringInvariant(TimeOnly) | |
| ToStringInvariant(TimeOnly, string) | |
| TruncateMilliseconds(DateTime) | Returns a new DateTime with the milliseconds component set to zero. |