Workbench User Guide : C. Data Format Templates : Date Format Templates : Time Interval Format Templates
 
Share this page          
Time Interval Format Templates
Time interval formats show the amount of elapsed time rather than an absolute date or time. Use interval templates for a date entry field that contains interval data.
As with the date format, you specify time interval formats by using a string to indicate exactly how you want a time interval to be printed. A representative interval has been selected to provide the example values you can use when specifying how you want the time to be printed. This example time interval is:
1 year 2 months 3 days 4 hours 5 minutes 6 seconds
You can arrange various combinations of the units of the time interval in any order.
Guidelines for Using Time Interval Templates
Observe the following guidelines when using interval templates:
There are 30.4375 days in a month and 365.25 days in a year.
The smallest unit specified is rounded up.
Numbers requiring more than one digit use up preceding blanks or zeros.
If there are no preceding blanks or zeros to the left, the number expands to the right. A blank following a letter, word, or number is not used up by a succeeding number. You can line up columns of numbers by preceding them with an appropriate number of blanks or zeros.
The word immediately following a number is made singular if the number is one, or plural if the number is zero or greater than one.
You can prevent this behavior by preceding the word with a backslash (\). Any character preceded by a backslash is printed as you enter it.
Examples of Time Interval Templates
The following table provides examples of time interval templates:
Format
Example Data
Output
1 year
3 years 5 mos 16 days
3 years
2 MONTHS, 3 DAYS
3 years 5 mos 1 days
41 MONTHS, 1 DAY
3
3 years 5 mos 16 days
1263
1 yr 3 day
1 yr 5 mos 16 days
1 yr 168 days
4 hours 6 seconds
23 hrs 8 mins 53 secs
23 hours 533 seconds
04:05 \hours
23 hrs 0 mins 53 secs
23:01 hours
3 days 4 hours
23 hrs 8 mins 53 secs
0 days 23 hours
1 yr 2 mos 3 days
200 yrs 11 mos 28 days
200 yrs 11 mos 28 days
1 yr 2 mos 3 days
5 yrs 1 mos 3 days
5 yrs 1 mo 3 days