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
695 B

  1. #!/bin/sh
  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 -n "date(1) \t"; date
  6. echo -n "date(1) UTC\t"; date -u
  7. echo -n "RFC 2822\t"; date --rfc-2822
  8. echo -n "RFC 3339 (date)\t"; date --rfc-3339=date
  9. echo -n "RFC 3339 (sec)\t"; date --rfc-3339=seconds
  10. echo -n "RFC 3339 (ns)\t"; date --rfc-3339=ns
  11. echo -n "ISO-8601\t"; date -Is
  12. echo -n "unix time\t"; date +%s
  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 -n "p1k3 dir\t" && todaydir