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

#!/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 "unix time\t"; date +%s
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
# 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