Class BirtDuration
PnYnMnDTnHnMnS
![]()
nY indicates the number of years
![]()
nM indicates the number of months
![]()
nD indicates the number of days
![]()
nH indicates the number of hours
![]()
nM indicates the number of minutes
![]()
nS indicates the number of secondsFor example, the following value indicates a duration of 2 years, 3 months, and 5 days:
The following value indicates a duration of 10 hours:
The BirtDuration class is static. The application cannot create instances of the class.
BirtDuration.add
This function adds two durations together, and returns the sum.
String. The first duration to add.
String. The second duration to add.
String. The sum of the two input durations.
The following example adds two durations:
BirtDuration.addTo
This function adds a duration to a specified Date object.
Date object. The date and time to modify.
Date object. The date advanced by the duration.
The following example adds one year to today’s date and time:
BirtDuration.compare
This function tests if a duration is the same, greater than, or less than another duration.
String. The first duration to use in the comparison.
String. The second duration to use in the comparison.
The following expressions compare the lengths of specific durations:
BirtDuration.day
This function returns the days value of a given duration.
String. A duration from which to get the days value.
An integer that represents the days value of the specified duration.
The following examples show the day values returned for specific durations:
BirtDuration.getSign
This function returns the sign of a duration.
String. The duration to analyze.
The following expression analyzes the sings of a specific duration:
BirtDuration.hour
This function returns the hours value of a given duration.
String. A duration from which to get the hours value.
An integer that represents the hours value of the specified duration.
The following examples show the hour values returned for specific durations:
BirtDuration.isLongerThan
String. The first duration to use in the comparison.
String. The second duration to use in the comparison.
Boolean. True if the first duration is longer than the second duration; returns false otherwise.
The following expressions compare the lengths of specific durations:
BirtDuration.isShorterThan
String. The first duration to use in the comparison.
String. The second duration to use in the comparison.
Boolean. True if the first duration is shorter than the second duration; returns false otherwise.
The following expressions compare the lengths of specific durations:
BirtDuration.minute
This function returns the minutes value of a given duration.
String. A duration from which to get the minutes value.
Integer. A number that represents the minutes value of the specified duration.
The following examples show the minutes values returned for specific durations:
BirtDuration.month
This function returns the months value of a given duration.
String. A duration from which to get the months value.
Integer. A number that represents the months value of the specified duration.
The following examples show the month values returned for specific durations:
BirtDuration.multiply
This function returns the product of a duration and a regular number.
String. A duration to multiply.
Integer. A regular number to multiply.
String. The product of the input duration and the factor.
The following examples show the products returned fora specific duration and factor:
BirtDuration.negate
This function returns the negative value of a duration.
String. The negative value of the input duration.
The following examples show the negative result from a specific duration:
BirtDuration.second
This function returns the seconds value of a given duration.
String. A duration from which to get the seconds value.
Integer. A number that represents the seconds value of the specified duration.
The following examples show the seconds values returned for specific durations:
BirtDuration.subtract
This function subtracts a duration from another duration.
String. The duration to subtract from.
String. The duration subtracted from lexicalDuration1.
String. The difference of the two input durations.
The following example subtracts two durations:
BirtDuration.timeInMills
String. A duration whose length in milliseconds to get.
Date object. Represents the start date.
Number object. The number of milliseconds in the specified duration.
BirtDuration.year
This function returns the year value of a given duration.
String. A duration from which to get the year value.
Integer. A number that represents the year value of the specified duration.
The following examples show the year values returned for specific durations:
(c) Copyright Actuate Corporation 2013 |