Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
714 B

  1. #!/usr/bin/env bash
  2. # display a list of some common date formats for the current time
  3. # because i never want to google a date format again
  4. # TODO: should probably take an input param
  5. echo -ne "unix time\t"; date +%s
  6. echo -ne "date(1) \t"; date
  7. echo -ne "date(1) UTC\t"; date -u
  8. echo -ne "RFC 2822\t"; date --rfc-2822
  9. echo -ne "RFC 3339 (date)\t"; date --rfc-3339=date
  10. echo -ne "RFC 3339 (sec)\t"; date --rfc-3339=seconds
  11. echo -ne "RFC 3339 (ns)\t"; date --rfc-3339=ns
  12. echo -ne "ISO-8601\t"; date -Is
  13. # do we have p1k3-specific tools?
  14. # TODO: this is an ugly idiom, and causes variant output
  15. # (because shell programming is _fucking stupid_)
  16. hash todaydir 2>/dev/null && echo -ne "p1k3 dir\t" && todaydir