Provides helper methods for rounding
DateTime values to natural boundaries (year, month, day, hour, minute, second)
and to multiples of a given
TimeSpan.
Inheritance Hierarchy Namespace: Altaxo.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntaxpublic static class DateTimeMath
The DateTimeMath type exposes the following members.
Methods| | Name | Description |
|---|
  | RoundDownMonths | Rounds down the date so that it starts at the first day of a month and is less than or equal to x.
The resulting month number then is 1 + k*n, with k being an integer. |
  | RoundDownSpan |
Rounds the date d down to the previous multiple of span, using a span-dependent origin.
|
  | RoundDownToStartOfDay |
The date x is rounded down to the start of a day. If x designates exactly the start of a day, then x is returned unchanged.
|
  | RoundDownToStartOfHour |
The date x is rounded down to the start of an hour. If x designates exactly the start of an hour, then x is returned unchanged.
|
  | RoundDownToStartOfMinute |
The date x is rounded down to the start of a minute. If x designates exactly the start of a minute, then x is returned unchanged.
|
  | RoundDownToStartOfMonth |
The date x is rounded down to the start of a month. If x designates exactly the start of a month, then x is returned unchanged.
|
  | RoundDownToStartOfSecond |
The date x is rounded down to the start of a second. If x designates exactly the start of a second, then x is returned unchanged.
|
  | RoundDownToStartOfYear |
The date x is rounded down to the start of a year. If x designates exactly the start of a year, then x is returned unchanged.
|
  | RoundDownYears | Rounds down the date so that it starts at the first day of a year and is less than or equal to x.
The resulting year number then is k*n, with k being an integer. |
  | RoundUpMonths | Rounds up the date so that it starts at the first day of a month and is greater than or equal to x.
The resulting month number then is 1 + k*n, with k being an integer. |
  | RoundUpSpan |
Rounds the date d up to the next multiple of span, using a span-dependent origin.
|
  | RoundUpToStartOfDay |
The date x is rounded up to the start of a day. If x designates exactly the start of a day, then x is returned unchanged.
|
  | RoundUpToStartOfHour |
The date x is rounded up to the start of an hour. If x designates exactly the start of an hour, then x is returned unchanged.
|
  | RoundUpToStartOfMinute |
The date x is rounded up to the start of a minute. If x designates exactly the start of a minute, then x is returned unchanged.
|
  | RoundUpToStartOfMonth |
The date x is rounded up to the start of a month. If x designates exactly the start of a month, then x is returned unchanged.
|
  | RoundUpToStartOfSecond |
The date x is rounded up to the start of a second. If x designates exactly the start of a second, then x is returned unchanged.
|
  | RoundUpToStartOfYear |
The date x is rounded up to the start of a year. If x designates exactly the start of a year, then x is returned unchanged.
|
  | RoundUpYears | Rounds up the date so that it starts at the first day of a year and is greater than or equal to x.
The resulting year number then is k*n, with k being an integer. |
Top
See Also