NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TimeSpan Constructor (Int32, Int32, Int32, Int32, Int32)

Initializes a new instance of the TimeSpan class to a specified number of days, hours, minutes, and seconds.

[Visual Basic]
Overloads Public Sub New( _
   ByVal days As Integer, _
   ByVal hours As Integer, _
   ByVal minutes As Integer, _
   ByVal seconds As Integer, _
   ByVal milliSeconds As Integer _
)
[C#]
public TimeSpan(
   int days,
   int hours,
   int minutes,
   int seconds,
   int milliSeconds
);
[C++]
public: TimeSpan(
   int days,
   int hours,
   int minutes,
   int seconds,
   int milliSeconds
);
[JScript]
public function TimeSpan(
   days : int,
   hours : int,
   minutes : int,
   seconds : int,
   milliSeconds : int
);

Parameters

days
A number of days.
hours
A number of hours.
minutes
A number of minutes.
seconds
A number of seconds.
milliSeconds
[To be supplied.]

Exceptions

Exception Type Condition
ArgumentException If any of the arguments are negative.
OverflowException If the computed ticks value is less than MinValue or greater than MaxValue.

Remarks

The Ticks s value is computed by converting hours and minutes into seconds, multiplying the total number of seconds by TicksPerSecond, and then adding this to the product of days and TicksPerDay. The equation is:

Ticks = (long)days * TicksPerDay + ((long)hour * 3600 + (long)minute * 60 + (long)second) * TicksPerSecond + milliSeconds * TicksPerSecond

See Also

TimeSpan Structure | TimeSpan Members | System Namespace | TimeSpan Constructor Overload List | Int64