Edit

Share via


DateInterval Enum

Definition

Indicates how to determine and format date intervals when calling date-related functions.

C#
public enum DateInterval
Inheritance
DateInterval

Fields

Name Value Description
Year 0

Year.

Quarter 1

Quarter of year (1 through 4)

Month 2

Month (1 through 12)

DayOfYear 3

Day of year (1 through 366)

Day 4

Day of month (1 through 31)

WeekOfYear 5

Week of year (1 through 53)

Weekday 6

Day of week (1 through 7)

Hour 7

Hour (0 through 23)

Minute 8

Minute (0 through 59)

Second 9

Second (0 through 59)

Remarks

When you call date-related functions, you can use enumeration members in your code in place of the actual values.

The DateInterval enumeration defines constants used with date-related functions to identify how date intervals are determined and formatted. For an example, see the DatePart method.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also