gemini-capsule

My gemini capsule
git clone git://jb55.com/gemini-capsule
Log | Files | Refs

datefmt.gmi (1671B)


      1 
      2 # datefmt
      3 
      4 datefmt is a simple C program that formats unix timestamps in text streams
      5 
      6 ## Examples
      7 
      8 Let's say we have some logs that contain unix timestamps:
      9 
     10 ```
     11 $ cat logs.txt
     12 
     13 EVENTS  1638499687   blahblah log1
     14 EVENTS  1638499717   blahblah log2
     15 ```
     16 
     17 We can pipe this log into datefmt to convert these timestamps into human-readable dates:
     18 
     19 ```
     20 $ <logs.txt datefmt
     21 
     22 EVENTS  2021-12-02 18:48   blahblah log1
     23 EVENTS  2021-12-02 18:48   blahblah log2
     24 ```
     25 
     26 Of course you can customize the format as well:
     27 
     28 ```
     29 $ <logs.txt datefmt "DATE:'%m-%d %R'"
     30 
     31 EVENTS  DATE:'12-02 18:48'   blahblah log1
     32 EVENTS  DATE:'12-02 18:48'   blahblah log2
     33 ```
     34 
     35 
     36 It's as simple as that! It comes with some heuristics so that it doesn't parse timestamp outside of a reasonable range.
     37 
     38 ## Download
     39 
     40 Tarballs are available here, please feel free to package this for your linux distribution of choice!
     41 
     42 => http://cdn.jb55.com/tarballs/datefmt/datefmt-0.2.1.tar.gz Latest Version (0.2.1)
     43 
     44 => http://cdn.jb55.com/tarballs/datefmt/SHA256SUMS.txt SHA256SUMS
     45 
     46 => http://cdn.jb55.com/tarballs/datefmt/SHA256SUMS.txt.asc SHA256SUMS Signature
     47 
     48 => https://jb55.com/pgp.txt My pgp key
     49 
     50 Download and verify:
     51 
     52 * `wget https://jb55.com/pgp.txt http://cdn.jb55.com/tarballs/datefmt/datefmt-0.2.1.tar.gz http://cdn.jb55.com/tarballs/datefmt/SHA256SUMS.txt http://cdn.jb55.com/tarballs/datefmt/SHA256SUMS.txt.asc`
     53 * `gpg --import < pgp.txt`
     54 * `sha256sum -c SHA256SUMS.txt`
     55 * `gpg --verify SHA256SUMS.txt.asc`
     56 
     57 => http://cdn.jb55.com/tarballs/datefmt Older versions
     58 
     59 
     60 ## Contributing
     61 
     62 Send patches to `jb55@jb55.com`
     63 
     64 => http://git.jb55.com/datefmt Sources
     65 
     66 => https://git-send-email.io/ How to send email patches