Hacker News new | ask | show | jobs
by neomantra 944 days ago
I love that others get excited about this. UNIX Timeval Aficionados should try out this tf tool [1]. I used my buddy's C/Lex/Yacc one daily for 1.5 decades, then ported it to Golang + Homebrew to share the love:

[1] https://github.com/neomantra/tf

  brew tap neomantra/homebrew-tap
  brew install tf
Printing out these round ones. `tf` auto-detects at 10-digits, so I started there in the `seq`.

  > for TV in $(seq -f %.f 1000000000 100000000 2000000000); do echo $TV $TV | tf -d ; done
  2001-09-08 18:46:40 1000000000
  2004-11-09 03:33:20 1100000000
  2008-01-10 13:20:00 1200000000
  2011-03-12 23:06:40 1300000000
  2014-05-13 09:53:20 1400000000
  2017-07-13 19:40:00 1500000000
  2020-09-13 05:26:40 1600000000
  2023-11-14 14:13:20 1700000000
  2027-01-15 00:00:00 1800000000
  2030-03-17 10:46:40 1900000000
  2033-05-17 20:33:20 2000000000
Some funny dates. -g detects multiple on a line, -d includes the date:

  > echo 1234567890 __ 3141592653 | tf -gd
  2009-02-13 15:31:30 __ 2069-07-20 17:37:33
Enjoy... may it save you time figuring out time!