Méthode | Description | |
---|---|---|
DateRangesCoverAllDates ( System.DateTime beginDate, System.DateTime endDate, DateTime?>.IEnumerable |
Returns true when each day between begin and end dates is represented inside one of the date ranges in dateRanges, inclusive. Be sure time information is not included. No begin date may be after an end date.
|
|
DateRangesOverlap ( System.DateTime rangeOneBegin, System.DateTime rangeOneEnd, System.DateTime rangeTwoBegin, System.DateTime rangeTwoEnd ) : bool |
Returns true if the two given date ranges overlap. Passing null for any date means infinity in that direction. Throws an exception if any of the given dates contains time information. Use .Date if you have to. See documentation for IsBetweenDates for more information on the date ranges.
|
|
DateTimeRangeOverlapsDateRange ( System.DateTime dateTimeRangeBegin, System.DateTime dateTimeRangeEnd, System.DateTime dateRangeBegin, System.DateTime dateRangeEnd ) : bool |
Returns true if the specified date/time range overlaps the specified date range. Passing null for any date means infinity in that direction. Throws an exception if the date range contains time information. Use .Date if you have to. See documentation for IsBetweenDates for more information on the date range.
|
|
DateTimeRangesOverlap ( System.DateTime rangeOneBegin, System.DateTime rangeOneEnd, System.DateTime rangeTwoBegin, System.DateTime rangeTwoEnd ) : bool |
Returns true if the two given DateTime ranges overlap. Passing null for any date/time means infinity in that direction.
|
|
GetDateOfDayOfWeekInMonth ( int year, int month, DayOfWeek day, int weeksFromFirst ) : System.DateTime |
Gets the date of the specified day of the week in the specified month.
|
|
GetNumberOfFullYearsBetweenDates ( System.DateTime beginDate, System.DateTime endDate ) : int |
This is useful for calculating someone's age. Beginning date must be before or equal to end date.
|
|
HasTime ( this dateTime ) : bool |
Returns true if this date/time contains time information.
|
|
IsBetweenDateTimes ( this dateTime, System.DateTime onOrAfterDate, System.DateTime onOrBeforeDate ) : bool |
Returns true if this date is in between the given DateTimes (inclusive at beginning of range, exclusive at end of range). Passing null for either of the two dates is considered to be infinity in that direction. Therefore, passing null for both dates will always result in true.
|
|
IsBetweenDates ( this dateTime, System.DateTime onOrAfterDate, System.DateTime onOrBeforeDate ) : bool |
Returns true if this date is in between (inclusive) the given dates. This method differs from IsBetweenDateTimes in that onOrAfterDate and onOrBeforeDate must be dates only (an exception will be thrown if time information is passed - use .Date if you have to.) and that it is inclusive on both ends of the range. This method also correctly returns true in the case where the dateTime parameter is 3:30PM on 11/15/09 and the onOrBeforeDate is 11/15/09. If you want to define a range with time information, use IsBetweenDateTimes instead. Passing null for either of the two dates is considered to be infinity in that direction. Therefore, passing null for both dates will always result in true.
|
|
MonthBeginDate ( this date ) : System.DateTime |
Returns the begin date of the specified date's month.
|
|
ToDayMonthYearString ( this dateTime, bool useLeadingZero, bool includeDayOfWeek = false ) : string |
Formats the date portion of the specified date/time in "day month year" style, e.g. 5 Apr 2008.
|
|
ToDayMonthYearString ( this dateTime, string stringIfNull, bool useLeadingZero, bool includeDayOfWeek = false ) : string |
Formats the date portion of the specified date/time in "day month year" style, e.g. 5 Apr 2008. Returns stringIfNull if the specified date/time is null.
|
|
ToHourAndMinuteString ( this dateTime ) : string |
Formats the time portion of the specified date/time in hour:minute style followed by a single lowercase letter indicating AM or PM.
|
|
ToHourAndMinuteString ( this dateTime, string stringIfNull ) : string |
Formats the time portion of the specified date/time in hour:minute style followed by a single lowercase letter indicating AM or PM. Returns stringIfNull if the specified date/time is null.
|
|
ToMonthDayYearString ( this dateTime ) : string |
Formats the date portion of the specified date/time in "01/01/2001" style.
|
|
ToMonthDayYearString ( this dateTime, string stringIfNull ) : string |
Formats the date portion of the specified date/time in "01/01/2001" style. Returns stringIfNull if the specified date/time is null.
|
|
ToMonthYearString ( this dateTime ) : string |
Formats the date portion of the specified date/time in "month year" style, e.g. April 2008.
|
|
WeekBeginDate ( this dateTime ) : System.DateTime |
Returns the date that the given week starts on.
|
|
WeeksFromFirstOccurrenceOfDayOfWeekInMonth ( this date, bool countBackwardFromFirstOccurrenceInNextMonth ) : int |
Returns the number of weeks from the first occurrence of the specified date's day of the week in the month to the specified date.
|
Méthode | Description | |
---|---|---|
assertDateTimeHasNoTime ( System.DateTime dateTime, string name ) : void |
public static DateRangesCoverAllDates ( System.DateTime beginDate, System.DateTime endDate, DateTime?>.IEnumerable |
||
beginDate | System.DateTime | |
endDate | System.DateTime | |
dateRanges | DateTime?>.IEnumerable | |
Résultat | bool |
public static DateRangesOverlap ( System.DateTime rangeOneBegin, System.DateTime rangeOneEnd, System.DateTime rangeTwoBegin, System.DateTime rangeTwoEnd ) : bool | ||
rangeOneBegin | System.DateTime | |
rangeOneEnd | System.DateTime | |
rangeTwoBegin | System.DateTime | |
rangeTwoEnd | System.DateTime | |
Résultat | bool |
public static DateTimeRangeOverlapsDateRange ( System.DateTime dateTimeRangeBegin, System.DateTime dateTimeRangeEnd, System.DateTime dateRangeBegin, System.DateTime dateRangeEnd ) : bool | ||
dateTimeRangeBegin | System.DateTime | |
dateTimeRangeEnd | System.DateTime | |
dateRangeBegin | System.DateTime | |
dateRangeEnd | System.DateTime | |
Résultat | bool |
public static DateTimeRangesOverlap ( System.DateTime rangeOneBegin, System.DateTime rangeOneEnd, System.DateTime rangeTwoBegin, System.DateTime rangeTwoEnd ) : bool | ||
rangeOneBegin | System.DateTime | |
rangeOneEnd | System.DateTime | |
rangeTwoBegin | System.DateTime | |
rangeTwoEnd | System.DateTime | |
Résultat | bool |
public static GetDateOfDayOfWeekInMonth ( int year, int month, DayOfWeek day, int weeksFromFirst ) : System.DateTime | ||
year | int | The year. |
month | int | The month. |
day | DayOfWeek | The day of the week. |
weeksFromFirst | int | The number of weeks from the first occurrence of the specified day of the week in the month. Pass a negative value to count /// backward from the first occurrence in the next month. |
Résultat | System.DateTime |
public static GetNumberOfFullYearsBetweenDates ( System.DateTime beginDate, System.DateTime endDate ) : int | ||
beginDate | System.DateTime | |
endDate | System.DateTime | |
Résultat | int |
public static HasTime ( this dateTime ) : bool | ||
dateTime | this | |
Résultat | bool |
public static IsBetweenDateTimes ( this dateTime, System.DateTime onOrAfterDate, System.DateTime onOrBeforeDate ) : bool | ||
dateTime | this | |
onOrAfterDate | System.DateTime | |
onOrBeforeDate | System.DateTime | |
Résultat | bool |
public static IsBetweenDates ( this dateTime, System.DateTime onOrAfterDate, System.DateTime onOrBeforeDate ) : bool | ||
dateTime | this | |
onOrAfterDate | System.DateTime | |
onOrBeforeDate | System.DateTime | |
Résultat | bool |
public static MonthBeginDate ( this date ) : System.DateTime | ||
date | this | |
Résultat | System.DateTime |
public static ToDayMonthYearString ( this dateTime, bool useLeadingZero, bool includeDayOfWeek = false ) : string | ||
dateTime | this | |
useLeadingZero | bool | |
includeDayOfWeek | bool | |
Résultat | string |
public static ToDayMonthYearString ( this dateTime, string stringIfNull, bool useLeadingZero, bool includeDayOfWeek = false ) : string | ||
dateTime | this | |
stringIfNull | string | |
useLeadingZero | bool | |
includeDayOfWeek | bool | |
Résultat | string |
public static ToHourAndMinuteString ( this dateTime ) : string | ||
dateTime | this | |
Résultat | string |
public static ToHourAndMinuteString ( this dateTime, string stringIfNull ) : string | ||
dateTime | this | |
stringIfNull | string | |
Résultat | string |
public static ToMonthDayYearString ( this dateTime ) : string | ||
dateTime | this | |
Résultat | string |
public static ToMonthDayYearString ( this dateTime, string stringIfNull ) : string | ||
dateTime | this | |
stringIfNull | string | |
Résultat | string |
public static ToMonthYearString ( this dateTime ) : string | ||
dateTime | this | |
Résultat | string |
public static WeekBeginDate ( this dateTime ) : System.DateTime | ||
dateTime | this | |
Résultat | System.DateTime |
public static WeeksFromFirstOccurrenceOfDayOfWeekInMonth ( this date, bool countBackwardFromFirstOccurrenceInNextMonth ) : int | ||
date | this | |
countBackwardFromFirstOccurrenceInNextMonth | bool | |
Résultat | int |