DateTimeMath Type

Static members

Static member Description

DateTimeMath.RoundDownMonths(x, n)

Full Usage: DateTimeMath.RoundDownMonths(x, n)

Parameters:
    x : DateTime - The date.
    n : int - The number of months to round down. Must be greater than or equal to 1.

Returns: DateTime A date <=x, and with a month number which is 1 + k*n. If the resulting month is <1, the year number is decreased accordingly.

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.

x : DateTime

The date.

n : int

The number of months to round down. Must be greater than or equal to 1.

Returns: DateTime

A date <=x, and with a month number which is 1 + k*n. If the resulting month is <1, the year number is decreased accordingly.

DateTimeMath.RoundDownSpan(d, span)

Full Usage: DateTimeMath.RoundDownSpan(d, span)

Parameters:
Returns: DateTime

d : DateTime
span : TimeSpan
Returns: DateTime

DateTimeMath.RoundDownToStartOfDay(x)

Full Usage: DateTimeMath.RoundDownToStartOfDay(x)

Parameters:
Returns: DateTime 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. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

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. The time zone information of the return value is copied from x.

DateTimeMath.RoundDownToStartOfHour(x)

Full Usage: DateTimeMath.RoundDownToStartOfHour(x)

Parameters:
Returns: DateTime 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. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

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. The time zone information of the return value is copied from x.

DateTimeMath.RoundDownToStartOfMinute(x)

Full Usage: DateTimeMath.RoundDownToStartOfMinute(x)

Parameters:
Returns: DateTime 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. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

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. The time zone information of the return value is copied from x.

DateTimeMath.RoundDownToStartOfMonth(x)

Full Usage: DateTimeMath.RoundDownToStartOfMonth(x)

Parameters:
Returns: DateTime 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. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

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. The time zone information of the return value is copied from x.

DateTimeMath.RoundDownToStartOfSecond(x)

Full Usage: DateTimeMath.RoundDownToStartOfSecond(x)

Parameters:
Returns: DateTime 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. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

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. The time zone information of the return value is copied from x.

DateTimeMath.RoundDownToStartOfYear(x)

Full Usage: DateTimeMath.RoundDownToStartOfYear(x)

Parameters:
Returns: DateTime 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. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

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. The time zone information of the return value is copied from x.

DateTimeMath.RoundDownYears(x, n)

Full Usage: DateTimeMath.RoundDownYears(x, n)

Parameters:
    x : DateTime - The date.
    n : int - The number of years to round down. Must be greater than or equal to 1.

Returns: DateTime A date <=x, and with a year number which is k*n.

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.

x : DateTime

The date.

n : int

The number of years to round down. Must be greater than or equal to 1.

Returns: DateTime

A date <=x, and with a year number which is k*n.

DateTimeMath.RoundUpMonths(x, n)

Full Usage: DateTimeMath.RoundUpMonths(x, n)

Parameters:
    x : DateTime - The date.
    n : int - The number of months to round up. Must be greater than or equal to 1.

Returns: DateTime A date >=x, and with a month number which is 1 + k*n. If the resulting month is >12, the year number is increased accordingly.

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.

x : DateTime

The date.

n : int

The number of months to round up. Must be greater than or equal to 1.

Returns: DateTime

A date >=x, and with a month number which is 1 + k*n. If the resulting month is >12, the year number is increased accordingly.

DateTimeMath.RoundUpSpan(d, span)

Full Usage: DateTimeMath.RoundUpSpan(d, span)

Parameters:
Returns: DateTime

d : DateTime
span : TimeSpan
Returns: DateTime

DateTimeMath.RoundUpToStartOfDay(x)

Full Usage: DateTimeMath.RoundUpToStartOfDay(x)

Parameters:
Returns: DateTime The date x is rounded up to the next start of a day. If x designates exactly the start of a day, then x is returned unchanged. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

The date x is rounded up to the next start of a day. If x designates exactly the start of a day, then x is returned unchanged. The time zone information of the return value is copied from x.

DateTimeMath.RoundUpToStartOfHour(x)

Full Usage: DateTimeMath.RoundUpToStartOfHour(x)

Parameters:
Returns: DateTime The date x is rounded up to the next start of an hour. If x designates exactly the start of an hour, then x is returned unchanged. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

The date x is rounded up to the next start of an hour. If x designates exactly the start of an hour, then x is returned unchanged. The time zone information of the return value is copied from x.

DateTimeMath.RoundUpToStartOfMinute(x)

Full Usage: DateTimeMath.RoundUpToStartOfMinute(x)

Parameters:
Returns: DateTime The date x is rounded up to the next start of a minute. If x designates exactly the start of a minute, then x is returned unchanged. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

The date x is rounded up to the next start of a minute. If x designates exactly the start of a minute, then x is returned unchanged. The time zone information of the return value is copied from x.

DateTimeMath.RoundUpToStartOfMonth(x)

Full Usage: DateTimeMath.RoundUpToStartOfMonth(x)

Parameters:
Returns: DateTime The date x is rounded up to the next start of a month. If x designates exactly the start of a month, then x is returned unchanged. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

The date x is rounded up to the next start of a month. If x designates exactly the start of a month, then x is returned unchanged. The time zone information of the return value is copied from x.

DateTimeMath.RoundUpToStartOfSecond(x)

Full Usage: DateTimeMath.RoundUpToStartOfSecond(x)

Parameters:
Returns: DateTime The date x is rounded up to the next start of a second. If x designates exactly the start of a second, then x is returned unchanged. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

The date x is rounded up to the next start of a second. If x designates exactly the start of a second, then x is returned unchanged. The time zone information of the return value is copied from x.

DateTimeMath.RoundUpToStartOfYear(x)

Full Usage: DateTimeMath.RoundUpToStartOfYear(x)

Parameters:
Returns: DateTime The date x is rounded up to the next start of a year. If x designates exactly the start of a year, then x is returned unchanged. The time zone information of the return value is copied from x.

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.

x : DateTime

The date argument.

Returns: DateTime

The date x is rounded up to the next start of a year. If x designates exactly the start of a year, then x is returned unchanged. The time zone information of the return value is copied from x.

DateTimeMath.RoundUpYears(x, n)

Full Usage: DateTimeMath.RoundUpYears(x, n)

Parameters:
    x : DateTime - The date.
    n : int - The number of years to round up. Must be greater than or equal to 1.

Returns: DateTime A date >=x, and with a year number which is k*n, with k being an integer.

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.

x : DateTime

The date.

n : int

The number of years to round up. Must be greater than or equal to 1.

Returns: DateTime

A date >=x, and with a year number which is k*n, with k being an integer.