Date time stamps are easy in bash:
> echo $(date +"%Y%m%d_%H%M%S") 20150915_214916
But I want more friendly date time stamps, like
Tuesday, 15th of September 2015, 09:54:42 PM.
#!/bin/bash n=$(date +"%d") if [ $n -ge 11 -a $n -le 13 ] ; then echo "th" else case $(( $n%10 )) in 1) echo st ;; 2) echo nd ;; 3) echo rd ;; *) echo th ;; esac fi
So now I can do:
> echo $(date +"%A, %d`dateOrdinal.sh` of %B %Y, %I:%M:%S %p") Tuesday, 15th of September 2015, 09:57:53 PM