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