Duration Class
The value expected by the setValue of the duration control is an object of type Duration. The table lists the methods for the Duration class.
Method | Return Value | Description |
---|---|---|
getYears() |
Integer | Returns the number of years set in duration. |
setYears(Integer years) |
Void | Sets number of years in duration. |
getMonths() |
Integer | Returns number of months set in duration. |
setMonths(Integer months) |
Void | Sets number of months in duration. |
getDays() |
Integer | Returns number of days set in duration. |
setDays(Integer days) |
Void | Sets number of days in duration. |
getHours() |
Integer | Returns number of hours set in duration. |
setHours(Integer hours) |
Void | Sets number of hours in duration. |
getMinutes() |
Integer | Returns number of minutes set in duration. |
setMinutes(Integer minutes) |
Void | Sets number of minutes in duration. |
getSeconds() |
Integer | Returns number of seconds set in duration. |
setSeconds(Integer seconds) |
Void | Sets number of seconds in duration. |
getMilliseconds() |
Integer | Returns number of milliseconds set in duration. |
setMilliseconds(Integer milliseconds) |
Void | Sets number of milliseconds in duration. |
isNegative() |
Boolean | Returns true if this duration is a negative duration. |
setIsNegative(Boolean isNegative) |
Void | Sets whether this duration should be treated as a negative duration. |
convert(Boolean years, Boolean months, Boolean days, Boolean hours, Boolean minutes, Boolean seconds) |
Void | Converts the internal state of the Duration object to use only the intervals specified as true. |
equals(Duration duration) |
Boolean | Returns true if the duration passed in is equal to this duration. |
compareTo(Duration duration) |
Integer | Returns a negative integer, zero, or a positive integer depending on whether this object is less than, equal to, or greater than the specified duration. |
add(Date originalDate) |
Date | Returns a new date that is the result of adding the duration to originalDate. |
toString() |
String | Returns the duration in an ISO-8601 string. |
Copyright © Cloud Software Group, Inc. All rights reserved.