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