altova::Duration
This class enables you to process XML attributes or elements of type xs:duration.
Constructors
Name | Description |
---|---|
Duration() | Initializes a new instance of the Duration class to an empty value. |
Duration(const DayTimeDuration& dt) | Initializes a new instance of the Duration class to a duration defined by the dt argument (see altova::DayTimeDuration ). |
Duration(const YearMonthDuration& ym) | Initializes a new instance of the Duration class to the duration defined by the ym argument (see altova::YearMonthDuration ). |
Duration(const YearMonthDuration& ym, const DayTimeDuration& dt) | Initializes a new instance of the Duration class to the duration defined by both the dt and the ym arguments (see altova::YearMonthDuration and altova::DayTimeDuration ). |
Methods
Name | Description |
---|---|
int Days() const | Returns the number of days in the current Duration instance. |
DayTimeDuration DayTime() const | Returns the day and time duration in the current Duration instance, expressed as a DayTimeDuration object (see altova::DayTimeDuration ). |
int Hours() const | Returns the number of hours in the current Duration instance. |
bool IsNegative() const | Returns Boolean true if the current Duration instance is negative. |
bool IsPositive() const | Returns Boolean true if the current Duration instance is positive. |
int Minutes() const | Returns the number of minutes in the current Duration instance. |
int Months() const | Returns the number of months in the current Duration instance. |
double Seconds() const | Returns the number of seconds in the current Duration instance. |
YearMonthDuration YearMonth() const | Returns the year and month duration in the current Duration instance, expressed as a YearMonthDuration object (see altova::YearMonthDuration ). |
int Years() const | Returns the number of years in the current Duration instance. |
Example
The following code listing illustrates creating a new Duration object, as well as reading values from it.
void ExampleDuration() |