etimefmt - luxembourg/muxcode-clm GitHub Wiki

ETIMEFMT()

FUNCTION: etimefmt(<format>, <secs>)

Escape sequences in <format> are expanded out. All escape sequences start with a $. Any unrecognized codes or other text is returned unchanged. An optional field width may be given after the initial $ (but before any modifier or format letters). All values are right-justified within the specified field.

Modifier letters (can be used together):

x - Value is suffixed with the corresponding units (s, m, h, or d). z - Enter escape becomes blank of corresponding value is zero.

Format letters:

$s - Seconds $S - Seconds, left-padded with zeroes. $m - Minutes. $M - Minutes, left-padded with zeroes. $h - Hours. $H - Hours, left-padded with zeroes. $d - Days. $D - Days, left-padded with zeros. $n - Newline $$ - $ character

Example: > think etimefmt($2h:$2M, 3700) 1:01

Related Topics: convtime, convsecs, timefmt