"Fossies" - the Fresh Open Source Software Archive

Member "dateutils-0.4.6/info/datediff.texi" (19 Mar 2019, 4681 Bytes) of package /linux/privat/dateutils-0.4.6.tar.xz:

Caution: As a special service "Fossies" has tried to format the requested Texinfo source page into HTML format but that may be not always succeeeded perfectly. Alternatively you can here view or download the uninterpreted Texinfo source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "datediff.texi": 0.4.5_vs_0.4.6.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1 datediff

datediff may be invoked with the following command-line options:

Usage: datediff [OPTION]... DATE/TIME [DATE/TIME]...

Compute duration from DATE/TIME (the reference date/time) to the other
DATE/TIMEs given and print the result as duration.
If the other DATE/TIMEs are omitted read them from stdin.

DATE/TIME can also be one of the following specials
  - `now'           interpreted as the current (UTC) time stamp
  - `time'          the time part of the current (UTC) time stamp
  - `today'         the current date (according to UTC)
  - `tomo[rrow]'    tomorrow's date (according to UTC)
  - `y[ester]day'   yesterday's date (according to UTC)

Note: The output format of durations (specified via -f) takes all format
specifiers into account, i.e. specifying %M and %S for example prints the
duration in minutes and seconds, whereas specifying %S only prints the duration
in seconds.

See section `The refinement rule' in datediff(1).

  -h, --help            Print help and exit
  -V, --version         Print version and exit
  -q, --quiet           Suppress message about date/time and duration
                        parser errors and fix-ups.
                        The default is to print a warning or the
                        fixed up value and return error code 2.
                        Also see -S|--skip-illegal to output an empty
                        line instead of leaving out the line altogether.
  -S, --skip-illegal    Deprecated, use -E|--empty-mode.
  -E, --empty-mode      Output empty lines as placeholder for illegal
                        input, i.e. parser errors or date/times that
                        cannot be subtracted.
  -f, --format=STRING   Output format.  This can either be a specifier
                        string (similar to strftime()'s FMT) or the name
                        of a calendar.
  -i, --input-format=STRING...
                        Input format, can be used multiple times.
                        Each date/time will be passed to the input
                        format parsers in the order they are given, if a
                        date/time can be read successfully with a given
                        input format specifier string, that value will
                        be used.
  -b, --base=DT         For underspecified input use DT as a fallback to
                        fill in missing fields.  Also used for ambiguous
                        format specifiers to position their range on the
                        absolute time line.
                        Must be a date/time in ISO8601 format.
                        If omitted defaults to the current date/time.
  -e, --backslash-escapes
                        Enable interpretation of backslash escapes in the
                        output and input format specifier strings.
                        Interpret dates on stdin or the command line as
                        coming from the locale LOCALE, this would only
                        affect month and weekday names as input formats
                        have to be specified explicitly.
      --from-zone=ZONE  Interpret dates on stdin or the command line as
                        coming from the time zone ZONE.

Report bugs to https://github.com/hroptatyr/dateutils/issues

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Examples

$ datediff 2012-03-02 2012-03-02
$ datediff 2012-03-02 2012-03-12
$ datediff 2012-03-02 2012-04-12
$ datediff 2012-03-12 2012-04-02
$ datediff 2012-04-02 2012-03-12
$ datediff 2012-01-02 2012-02-29 -f '%dd'
$ datediff 2012-01-02 2012-02-29 -f '%ww %dd'
8w 2d
$ datediff 10:00:00 10:00:00
$ datediff 10:01:00 10:06:00
$ datediff 10:06:00 10:01:00
$ datediff 10:01:00 11:03:10 -f '%S sec'
3730 sec
$ datediff 10:01:00 11:03:10 -f '%Mm %Ss'
62m 10s
$ datediff 10:01:00 11:03:10 -f '%H:%M:%S'
$ datediff 2012-03-02T10:04:00 2012-03-02T10:14:00
$ datediff 2012-03-02T10:04:00 2012-03-02T10:14:00 -f '%M min'
10 min
$ datediff 2012-03-01T12:17:00 2012-03-02T14:00:00
$ datediff 2012-03-01T12:17:00 2012-03-02T14:00:00 -f '%d days and %S seconds'
1 days and 6180 seconds

[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated on March 25, 2019 using texi2html.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ < ] Back Previous section in reading order 1.2.2
[ Up ] Up Up section 1.2
[ > ] Forward Next section in reading order 1.2.4
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

This document was generated on March 25, 2019 using texi2html.