User Commands  - days2sec (1)

NAME

days2sec(1f) - [TIME] Convert [[-]dd-][[hh:]mm:]ss to seconds (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
See Also
Author
License

SYNOPSIS

Forms:

    days2sec dd-hh:mm:ss
    days2sec NNdNNhNNmNNs
    days2sec --version| --help

DESCRIPTION

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.

OPTIONS

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
                           ss

convert 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,secs

The 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

EXAMPLES

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

SEE ALSO

sec2days(1)

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 days2sec (1) February 23, 2025
Generated by manServer 1.08 from 2d9b6079-4aaa-48d9-85af-e27c175ce5c3 using man macros.