1 02/08/85 date_time_interval, dti
2
3 Syntax as a command: dti time_string1 time_string2 -control_args
4
5
6 Syntax as an active function:
7 dti time_string1 time_string2 -control_args
8
9
10 Function: returns the difference between two date values, relative to
11 the first, in offset terms: "0 yr 0 mo -2 da -6 hr 0 min -4.64 sec".
12 You are able to specify that the result be only in terms of certain
13 units.
14
15
16 Arguments:
17 time_string1
18 is the beginning of the interval. If not specified, the current
19 time is used see "Notes".
20 time_string2
21 is the end of the interval. If the end is earlier than the
22 beginning, all numbers are preceeded by a minus sign see "Notes".
23
24
25 Control arguments:
26 -brief, -bf
27 specifies that the units displayed are in the abbreviated form
28 Default.
29 -fractional_digits N, -fd N
30 specifies the maximum number of fractional digits to be included on
31 the smallest unit. The value being formatted is rounded to the
32 number of digits specified. All trailing zeros are removed and then
33 the decimal point if it is last. N can't exceed 20. If you supply
34 no N, the maximum is used. Default: 2
35 -zero_units, -zu
36 specifies that all units are output even if their value is zero
37 e.g. "2 da 0 hr 0 min 4.2 sec".
38
39
40 -language STR -lang STR
41 STR specifies the language in which the result is to be expressed.
42 This can be in any of the languages known to the date/time system.
43 If STR is "system_lang" the system default is used. If you choose
44 no -language or it is present with STR being "" the per-process
45 default is used. Use the display_time_info command to obtain a list
46 of acceptable language values.
47 -long -lg
48 specifies that the units displayed are in the singular/plural form.
49 -no_zero_units -nzu
50 specifies that any unit that has a value of zero are not included in
51 the output; however if all units are zero the smallest is shown
52 with the value of "0". Example: "2 da 4.2 sec". Default
53
54
55 -units STRs
56 specifies that the result is to be expressed in terms of a given set
57 of units. All arguments following -units on the command line are
58 taken as the set of units to use; therefore make -units if given
59 the last control argument. You can enter the units in any language
60 available on the site and in any order. All units however must be
61 in the same language. These are the units that you can specify:
62 year month week day hour minute second and microsecond. The
63 output appears in that order.
64
65
66 Notes: When you specify no units this set is used--years months
67 days hours minutes seconds. A default result could look like this:
68 "-2 da -6 hr -4.05 sec"; but if the arguments given were: -fd -units
69 hr min the same interval could be: -54 hr -0.0676252166666666666 min.
70 Note that there is a truncation in the first instance to two decimal
71 places with the corresponding loss of accuracy.
72
73 See time_strings.gi for a description of valid time_string values.