util::age_pretty (public)
util::age_pretty -timestamp_ansi timestamp_ansi \ -sysdate_ansi sysdate_ansi [ -hours_limit hours_limit ] \ [ -days_limit days_limit ] [ -mode_2_fmt mode_2_fmt ] \ [ -mode_3_fmt mode_3_fmt ] [ -locale locale ]
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Formats past time intervals in one of three different modes depending on age. The first mode is "1 hour 3 minutes" and is NOT currently internationalized. The second mode is e.g. "14:10, Thursday" and is internationalized. The third mode is "14:10, 01 Mar 2001" and is internationalized. Both the locale and the exact format string for modes 2 and 3 can be overridden by parameters. (Once mode 1 is i18nd, the following sentence will be true:'In mode 1, only the locale can be overridden.' Until then, move along. These aren't the timestamps you're looking for.)
- Switches:
- -timestamp_ansi
(required)- The older timestamp in full ANSI: YYYY-MM-DD HH24:MI:SS
- -sysdate_ansi
(required)- The newer timestamp.
- -hours_limit
(defaults to"12"
) (optional)- The upper limit, in hours, for mode 1.
- -days_limit
(defaults to"3"
) (optional)- The upper limit, in days, for mode 2.
- -mode_2_fmt
(defaults to"%X, %A"
) (optional)- A formatting string, as per lc_time_fmt, for mode 2
- -mode_3_fmt
(defaults to"%X, %d %b %Y"
) (optional)- A formatting string, as per lc_time_fmt, for mode 3
- -locale
(optional)- If present, overrides the default locale
- Returns:
- Interval between timestamp and sysdate, as localized text string.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- util__age_pretty