| DateTimeExtensions Class |
Namespace: Entelect.Extensions
public static class DateTimeExtensions
The DateTimeExtensions type exposes the following members.
| Name | Description | |
|---|---|---|
| ConvertRegionalTimeToUtc |
Converts regional time to utc
| |
| ConvertUtcToRegionalTime |
Converts utc to regional time
| |
| GetTimespanBetweenDates |
Gets the timespan between two dates
| |
| Midnight |
Returns the date part of the input date with the time of day as 00:00:00. Equivalent to DateTime.Date.
| |
| MonthsFromStartDateToEndDate |
Gets the number of months between the current date and the supplied date
| |
| Noon |
Returns the date part of the input date with the time of day as 12:00:00.
| |
| NumberOfBusinessDaysUntil |
Calculates number of business days, taking into account:
- weekends (Saturdays and Sundays)
- bank holidays in the middle of the week
| |
| SetTime(DateTime, Int32, Int32) |
Sets the time of the current date with minute precision
| |
| SetTime(DateTime, Int32, Int32, Int32) |
Sets the time of the current date with second precision
| |
| SetTime(DateTime, Int32, Int32, Int32, Int32) |
Sets the time of the current date with millisecond precision
| |
| ToFirstDayOfMonth |
Gets the first day of the month at time 00:00:00 for the supplied date
| |
| ToFirstDayOfNextMonth |
Gets the first day of the next month of the input datetime
| |
| ToJSONTicks |
Returns a JSON representation of the provided date time
| |
| ToLastDayOfMonth |
Gets the last day of the month at time 00:00:00 for the supplied date
| |
| ToLastMillisecondOfDay |
Gets the date time one milisecond before midnight on the current day
|