Writing Expressions : Manipulating date-and-time data : Calculating the time between two dates
 
Calculating the time between two dates
It is often useful to calculate and display the number of days, months, or years between two dates. For example, a data source might store two dates for each order record—the date on which the order was placed and the date on which the order was shipped. To provide information about order fulfillment trends, use BIRT’s BirtDateTime functions to calculate and display the number of days between the order date and the ship date, as follows:
BirtDateTime.diffDay(row["orderDate"], row["shippedDate"])
You can also display the number of hours between the two dates, using the following expression:
BirtDateTime.diffHour(row["orderDate"], row["shippedDate"])
Use a different BirtDateTime function, depending on the range of time between two dates. For example, you would not use BirtDateTime.diffMonth( ) to calculate the amount of time between order dates and ship dates because if orders are usually shipped within two weeks, BirtDateTime.diffMonth( ) would often return 0.