datefmt

format unix timestamps over stdin
git clone git://jb55.com/datefmt
Log | Files | Refs | README | LICENSE

datefmt.scd (1014B)


      1 datefmt(1)
      2 
      3 # NAME
      4 
      5 datefmt - format timestamps in text streams
      6 
      7 # SYNPOSIS
      8 
      9 *datefmt* [--after timestamp] [--before timestamp] [--past] [--future] [--version] [--ms]
     10 
     11 # DESCRIPTION
     12 
     13 *datefmt* is a tool that formats timestamps in text streams. For example,
     14 if you have a log file with unix timestamps, you can pipe it to datefmt
     15 to convert these timestamps into formatted dates.
     16 
     17 # OPTIONS
     18 
     19 *-a, --after <timestamp>*
     20 	only format timestamps after this date (default: 2000-01-01Z)
     21 
     22 *-b, --before <timestamp>*
     23 	only format timestamps before this date 
     24 
     25 *-p, --past*
     26 	only format timestamps in the past
     27 
     28 *-f, --future*
     29 	only format timestamps in the future
     30 
     31 *-m, --ms*
     32 	interpret timestamps as milliseconds instead of seconds
     33 
     34 *-r, --relative*
     35 	relative timestmap formatting
     36 
     37 *--version*
     38 	display version and exit
     39 
     40 # FORMAT
     41 
     42 a strftime(3) format string. defaults to '%F %R'. The default can be changed
     43 with the *DEFAULT_DATEFMT* environment variable.
     44 
     45 # EXAMPLE
     46 
     47 datefmt --after $(date -d yesterday +%s) %R < log.txt