days2sec(1f) - [TIME] Convert [[-]dd-][[hh:]mm:]ss to seconds (LICENSE:PD)
Synopsis
Description
Options
Examples
See Also
Author
License
Forms:
days2sec dd-hh:mm:ss days2sec NNdNNhNNmNNs days2sec --version| --help
Given a duration in the form dd-hh:mm:ss where dd is days, hh hours, mm minutes and ss seconds convert it to seconds. Many utilities (ps(1), for example) show times in this format to make it more intelligible; but it generally easier to perform math on values represented in seconds.
dd-hh:mm:ss Given a string representing a duration of time in the following forms: dd-hh:mm:ss hh:mm:ss mm:ss ssconvert it to seconds.
The numeric values may represent floating point numbers.
Spaces are ignored.
NNdNNhNNmNNs Simple numeric values may also be used with unit suffixes; where s,m,h, or d represents seconds, minutes, hours or days and w represents weeks. Allowed aliases for w,d,h,m, and s units are w - weeks,week,wk,wks d - days,day m - minutes,minute,min h - hours,hour,hrs,hr s - seconds,second,sec,secsThe numeric values may represent floating point numbers.
Spaces, commas and case are ignored. --denominator divide the result by this value. Default is one(1). --help display this help and exit --version output version information and exit
Usage
days2sec 1-12:04:20 129860 days2sec 1.5 days 129600 days2sec 1.5 days 4hrs 30minutes 145800 days2sec 10s 10S 10s # DUPLICATES WITH UNITS ARE ALLOWED 30 days2sec 1 1 1 # SPACES ARE IGNORED 111
sec2days(1)
John S. Urban
Public Domain
Nemo Release 3.1 | days2sec (1) | February 23, 2025 |