Duration ClassA Sandcastle Documented Class Library
A duration on the form P[yY][mM][dD][T[hH][mM][sS]] or P[wW], that specifies the length of a time interval.
Inheritance Hierarchy

SystemObject
  Apptus.ESales.Connector.TimeDuration

Namespace:  Apptus.ESales.Connector.Time
Assembly:  Apptus.Esales.ConnectorApi (in Apptus.Esales.ConnectorApi.dll) Version: 4.3.0
Syntax

C#
public class Duration

The Duration type exposes the following members.

Properties

  NameDescription
Public propertyPrecision
The finest unit with a specified amount for this duration. For instance, the duration PT1M has minute precision, while PT1M0S has second precision (even if the number of seconds specified is zero).
Top
Methods

  NameDescription
Public methodAdd
Creates a third duration being the sum of this duration and the argument duration.
Public methodAmount
Returns the amount of a certain unit. This is not a total amount, but instead the amount specified for the specified field.
Public methodBack
Returns a date time that denotes the point in time at the length of this duration back in time from the specified date time.
Public methodStatic memberCreate
Creates a duration with a certain amount of a specified unit.
Public methodEquals

True if the argument is a duration with the same or equivalent specification. Note that P1W equals P7D by definition, whereas e.g. P1M does not equal P30D since months are not 30 days in general. Less obvious, P1D is not equal to P24H in general.

Years are normalized to months, weeks to days and hours and minutes to seconds. After normalization, both durations are compared component by component. Iff all components match, this method returns true.

(Overrides ObjectEquals(Object).)
Protected methodFinalize (Inherited from Object.)
Public methodForward
Returns a date time that denotes the point in time at the length of this duration forward in time from the specified date time.
Public methodStatic memberFromTimeSpan
Creates a duration from a TimeSpan object. Milliseconds are truncated to the seconds.
Public methodGetHashCode (Overrides ObjectGetHashCode.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberParse
Parses a duration.
Public methodToString (Overrides ObjectToString.)
Top
See Also

Reference