ITimeDuration Interface

Provides access to members that control the Time Duration.

Description

The ITimeDuration interface is used to deal with time values which are simply a length of time, but not associated with a specific point in time. For example, 3 hours is a TimeDuration since it does not tell you if it represents 1:00-4:00 or 5:00-8:00. If you need to associate the TimeDuration with a specific point on the time line, you should use a TimeExtent.

Members

Name Description
Method AddDays Adds the input amount of days to the time duration.
Method AddDuration Adds a time duration.
Method AddHours Adds the input amount of hours to the time duration.
Method AddMilliseconds Adds the input amount of milliseconds to the time duration.
Method AddMinutes Adds the input amount of minutes to the time duration.
Method AddNanoseconds Adds the input amount of nanoseconds to the time duration.
Method AddSeconds Adds the input amount of seconds to the time duration.
Method AddWeeks Adds the input amount of weeks to the time duration.
Method Compare Compares this time duration to the other time duration. Returns -1 if this time duration's value is less, 1 if greater, and 0 otherwise.
Read/write property Days The time duration days component.
Read/write property Hours The time duration hours component.
Method IsZero Indicates whether the time duration's value is zero.
Read/write property Minutes The time duration minutes component.
Read/write property Nanoseconds The time duration nanoseconds component.
Read/write property Positive Indicates whether the time duration value is positive or negative.
Method QueryDayFraction The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method QueryDayFractionNanoseconds The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method QueryTicks Obtains the time duration as the number of ticks.
Method QueryTotalDays Obtains the time duration as total days floating point value.
Method QueryTotalHours Obtains the time duration as total hours floating point value.
Method QueryTotalMinutes Obtains the time duration as total minutes floating point value.
Method QueryTotalSeconds Obtains the time duration as total seconds floating point value.
Method QueryWKSTimeDuration Obtains time as a WKSTimeDuration.
Method QueryXMLTimeDurationString Obtains the time duration as an XML time duration string.
Method Reset Reset the time duration to zero.
Method Scale Scales the time duration by a scale factor.
Read/write property Seconds The time duration seconds component.
Method SetDayFraction The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method SetDayFractionNanoseconds The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method SetFromTicks Writes the time duration from a given number of ticks.
Method SetFromWKSTimeDuration Writes the time from a given WKSTimeDuration value.
Method SetFromXMLTimeDurationString Writes the time duration from an XML time duration string.
Method SubtractDuration Subtracts a time duration.

ITimeDuration.AddDays Method

Adds the input amount of days to the time duration.

Public Sub AddDays ( _
    ByVal Value As Double _
)
public void AddDays (
    double Value
);

ITimeDuration.AddDuration Method

Adds a time duration.

Public Sub AddDuration ( _
    ByVal TimeDuration As ITimeDuration _
)
public void AddDuration (
    ITimeDuration TimeDuration
);

ITimeDuration.AddHours Method

Adds the input amount of hours to the time duration.

Public Sub AddHours ( _
    ByVal Value As Double _
)
public void AddHours (
    double Value
);

ITimeDuration.AddMilliseconds Method

Adds the input amount of milliseconds to the time duration.

Public Sub AddMilliseconds ( _
    ByVal Value As Double _
)
public void AddMilliseconds (
    double Value
);

ITimeDuration.AddMinutes Method

Adds the input amount of minutes to the time duration.

Public Sub AddMinutes ( _
    ByVal Value As Double _
)
public void AddMinutes (
    double Value
);

ITimeDuration.AddNanoseconds Method

Adds the input amount of nanoseconds to the time duration.

Public Sub AddNanoseconds ( _
    ByVal Value As Long _
)
public void AddNanoseconds (
    long Value
);

ITimeDuration.AddSeconds Method

Adds the input amount of seconds to the time duration.

Public Sub AddSeconds ( _
    ByVal Value As Double _
)
public void AddSeconds (
    double Value
);

ITimeDuration.AddWeeks Method

Adds the input amount of weeks to the time duration.

Public Sub AddWeeks ( _
    ByVal Value As Double _
)
public void AddWeeks (
    double Value
);

ITimeDuration.Compare Method

Compares this time duration to the other time duration. Returns -1 if this time duration's value is less, 1 if greater, and 0 otherwise.

Public Function Compare ( _
    ByVal otherDuration As ITimeDuration _
) As Integer
public int Compare (
    ITimeDuration otherDuration
);

ITimeDuration.Days Property

The time duration days component.

Public Property Days As Integer
public int Days {get; set;}

ITimeDuration.Hours Property

The time duration hours component.

Public Property Hours As Integer
public int Hours {get; set;}

ITimeDuration.IsZero Method

Indicates whether the time duration's value is zero.

Public Function IsZero ( _
) As Boolean
public bool IsZero (
);

ITimeDuration.Minutes Property

The time duration minutes component.

Public Property Minutes As Integer
public int Minutes {get; set;}

ITimeDuration.Nanoseconds Property

The time duration nanoseconds component.

Public Property Nanoseconds As Integer
public int Nanoseconds {get; set;}

ITimeDuration.Positive Property

Indicates whether the time duration value is positive or negative.

Public Property Positive As Boolean
public bool Positive {get; set;}

ITimeDuration.QueryDayFraction Method

The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Public Function QueryDayFraction ( _
) As Double
public double QueryDayFraction (
);

ITimeDuration.QueryDayFractionNanoseconds Method

The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Public Function QueryDayFractionNanoseconds ( _
) As Long
public long QueryDayFractionNanoseconds (
);

ITimeDuration.QueryTicks Method

Obtains the time duration as the number of ticks.

Public Function QueryTicks ( _
) As Long
public long QueryTicks (
);

Remarks

Using the QueryTicks function allows you to find the Ticks value, which is used in many Windows time controls.

ITimeDuration.QueryTotalDays Method

Obtains the time duration as total days floating point value.

Public Function QueryTotalDays ( _
) As Double
public double QueryTotalDays (
);

ITimeDuration.QueryTotalHours Method

Obtains the time duration as total hours floating point value.

Public Function QueryTotalHours ( _
) As Double
public double QueryTotalHours (
);

ITimeDuration.QueryTotalMinutes Method

Obtains the time duration as total minutes floating point value.

Public Function QueryTotalMinutes ( _
) As Double
public double QueryTotalMinutes (
);

ITimeDuration.QueryTotalSeconds Method

Obtains the time duration as total seconds floating point value.

Public Function QueryTotalSeconds ( _
) As Double
public double QueryTotalSeconds (
);

ITimeDuration.QueryWKSTimeDuration Method

Obtains time as a WKSTimeDuration.

Public Function QueryWKSTimeDuration ( _
) As WKSTimeDuration
public WKSTimeDuration QueryWKSTimeDuration (
);

ITimeDuration.QueryXMLTimeDurationString Method

Obtains the time duration as an XML time duration string.

Public Function QueryXMLTimeDurationString ( _
) As String
public string QueryXMLTimeDurationString (
);

ITimeDuration.Reset Method

Reset the time duration to zero.

Public Sub Reset ( _
)
public void Reset (
);

ITimeDuration.Scale Method

Scales the time duration by a scale factor.

Public Sub Scale ( _
    ByVal scaleFactor As Double _
)
public void Scale (
    double scaleFactor
);

Description

The scale function can be used to increase or decrease the given duration. For example, if you want to divide a time extent into 5 equal segments, you can get the TimeDuration from the TimeExent, then scale the TimeDuration by 1/5 and add the resulting TimeDuration to the TimeExtent's Start Time.

ITimeDuration.Seconds Property

The time duration seconds component.

Public Property Seconds As Integer
public int Seconds {get; set;}

ITimeDuration.SetDayFraction Method

The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Public Sub SetDayFraction ( _
    ByVal dayFraction As Double _
)
public void SetDayFraction (
    double dayFraction
);

ITimeDuration.SetDayFractionNanoseconds Method

The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Public Sub SetDayFractionNanoseconds ( _
    ByVal dayFractionNanoseconds As Long _
)
public void SetDayFractionNanoseconds (
    long dayFractionNanoseconds
);

ITimeDuration.SetFromTicks Method

Writes the time duration from a given number of ticks.

Public Sub SetFromTicks ( _
    ByVal ticks As Long _
)
public void SetFromTicks (
    long ticks
);

ITimeDuration.SetFromWKSTimeDuration Method

Writes the time from a given WKSTimeDuration value.

Public Sub SetFromWKSTimeDuration ( _
    ByRef TimeDuration As WKSTimeDuration _
)
public void SetFromWKSTimeDuration (
    ref WKSTimeDuration TimeDuration
);

ITimeDuration.SetFromXMLTimeDurationString Method

Writes the time duration from an XML time duration string.

Public Sub SetFromXMLTimeDurationString ( _
    ByVal xmlTimeDurationString As String _
)
public void SetFromXMLTimeDurationString (
    string xmlTimeDurationString
);

ITimeDuration.SubtractDuration Method

Subtracts a time duration.

Public Sub SubtractDuration ( _
    ByVal TimeDuration As ITimeDuration _
)
public void SubtractDuration (
    ITimeDuration TimeDuration
);

Classes that implement ITimeDuration

Classes Description
TimeDuration An object that represents a time duration value.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.