Duration Constructor (int, int, int, int, int, decimal)Duration Constructor (Integer, Integer, Integer, Integer, Integer, Decimal)Duration Constructor (int, int, int, int, int, decimal)

Initializes a new instance of the DurationDurationDuration structure with the specified year, month, day, hour, minute and second components.

Syntax

Public Sub New ( _
    year As Integer, _
    month As Integer, _
    day As Integer, _
    hour As Integer, _
    minute As Integer, _
    second As Decimal _
)
public Duration(
    int year,
    int month,
    int day,
    int hour,
    int minute,
    decimal second
)
public:
Duration(
    int year, 
    int month, 
    int day, 
    int hour, 
    int minute, 
    decimal second
)
 

Parameters

year

Type: System.Int32System.Int32System::Int32

The number of years.

month

Type: System.Int32System.Int32System::Int32

The number of months.

day

Type: System.Int32System.Int32System::Int32

The number of days.

hour

Type: System.Int32System.Int32System::Int32

The number of hours.

minute

Type: System.Int32System.Int32System::Int32

The number of minutes.

second

Type: System.DecimalSystem.DecimalSystem::Decimal

The number of seconds.

Exceptions

ExceptionCondition
OverflowExceptionOverflowExceptionOverflowExceptionThe duration components represent a duration less than MinValueMinValueMinValue or greater than MaxValueMaxValueMaxValue.