Click or drag to resize
DateTimeExtensions Class
A collection of custom extensions for the built in DateTime class.
Inheritance Hierarchy
SystemObject
  Entelect.ExtensionsDateTimeExtensions

Namespace: Entelect.Extensions
Assembly: Entelect (in Entelect.dll) Version: 0.0.79
Syntax
C#
public static class DateTimeExtensions

The DateTimeExtensions type exposes the following members.

Methods
  NameDescription
Public methodStatic memberConvertRegionalTimeToUtc
Converts regional time to utc
Public methodStatic memberConvertUtcToRegionalTime
Converts utc to regional time
Public methodStatic memberGetTimespanBetweenDates
Gets the timespan between two dates
Public methodStatic memberMidnight
Returns the date part of the input date with the time of day as 00:00:00. Equivalent to DateTime.Date.
Public methodStatic memberMonthsFromStartDateToEndDate
Gets the number of months between the current date and the supplied date
Public methodStatic memberNoon
Returns the date part of the input date with the time of day as 12:00:00.
Public methodStatic memberNumberOfBusinessDaysUntil
Calculates number of business days, taking into account: - weekends (Saturdays and Sundays) - bank holidays in the middle of the week
Public methodStatic memberSetTime(DateTime, Int32, Int32)
Sets the time of the current date with minute precision
Public methodStatic memberSetTime(DateTime, Int32, Int32, Int32)
Sets the time of the current date with second precision
Public methodStatic memberSetTime(DateTime, Int32, Int32, Int32, Int32)
Sets the time of the current date with millisecond precision
Public methodStatic memberToFirstDayOfMonth
Gets the first day of the month at time 00:00:00 for the supplied date
Public methodStatic memberToFirstDayOfNextMonth
Gets the first day of the next month of the input datetime
Public methodStatic memberToJSONTicks
Returns a JSON representation of the provided date time
Public methodStatic memberToLastDayOfMonth
Gets the last day of the month at time 00:00:00 for the supplied date
Public methodStatic memberToLastMillisecondOfDay
Gets the date time one milisecond before midnight on the current day
Top
See Also