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 | |
---|---|---|
AddDays | Adds the input amount of days to the time duration. | |
AddDuration | Adds a time duration. | |
AddHours | Adds the input amount of hours to the time duration. | |
AddMilliseconds | Adds the input amount of milliseconds to the time duration. | |
AddMinutes | Adds the input amount of minutes to the time duration. | |
AddNanoseconds | Adds the input amount of nanoseconds to the time duration. | |
AddSeconds | Adds the input amount of seconds to the time duration. | |
AddWeeks | Adds the input amount of weeks to the time duration. | |
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. | |
Days | The time duration days component. | |
Hours | The time duration hours component. | |
IsZero | Indicates whether the time duration's value is zero. | |
Minutes | The time duration minutes component. | |
Nanoseconds | The time duration nanoseconds component. | |
Positive | Indicates whether the time duration value is positive or negative. | |
QueryDayFraction | The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties. | |
QueryDayFractionNanoseconds | The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties. | |
QueryTicks | Obtains the time duration as the number of ticks. | |
QueryTotalDays | Obtains the time duration as total days floating point value. | |
QueryTotalHours | Obtains the time duration as total hours floating point value. | |
QueryTotalMinutes | Obtains the time duration as total minutes floating point value. | |
QueryTotalSeconds | Obtains the time duration as total seconds floating point value. | |
QueryWKSTimeDuration | Obtains time as a WKSTimeDuration. | |
QueryXMLTimeDurationString | Obtains the time duration as an XML time duration string. | |
Reset | Reset the time duration to zero. | |
Scale | Scales the time duration by a scale factor. | |
Seconds | The time duration seconds component. | |
SetDayFraction | The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties. | |
SetDayFractionNanoseconds | The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties. | |
SetFromTicks | Writes the time duration from a given number of ticks. | |
SetFromWKSTimeDuration | Writes the time from a given WKSTimeDuration value. | |
SetFromXMLTimeDurationString | Writes the time duration from an XML time duration string. | |
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. |