Duration fields

A Duration field contains a value that is the length of a period of time expressed in years, months, weeks, days, hours, minutes and seconds. The form uses all the usual field properties, which are described in "Field properties". There are some additional properties.

The Default Value property is used to specify an initial value for the field. To enter an initial value, click the Enter hyperlink. A small form pops up in which you to enter the quantity of years, months, weeks, days, hours, minutes, and seconds that are the field's initial value.

The Formula Type is visible only when Formula is selected. It is determined by a pair of radio buttons labeled Regular and Extended. Selecting the Regular radio button brings the Formula Field property. How to specify a regular formula is described in Formulas. Selecting the Extended radio button and then the Enter hyperlink brings the Extended Formula panel. How to specify an extended formula is described in Application Building for the IBM® Maximo® Real Estate and Facilities: Calculations.

Duration is stored in the Maximo Real Estate and Facilities database as a long value. When saving duration values with a workflow or IBM Maximo Real Estate and Facilities Connector for Business Applications, use the following format to ensure your users see the correct value in a form. The formula is as follows:

(100000000000000 * ((years * 12) + months)) + (weeks * 604800000) + (days * 86400000) + (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds

Tip: Be careful when comparing duration fields in months or years in a formula. A year is equal to 365 days in milliseconds. A month is equal to 365 days in milliseconds divided by 12. When doing fencing comparisons, the length of a month is the same for any month, which can be misleading if comparing against actual dates since there are several months that do not have this exact number of days. The same is true for years since a leap year has an extra day.
Tip: Duration field names should end with DU for easy identification later, e.g., cstMeetingDurationDU.