Skip to content

Instantly share code, notes, and snippets.

@jaredmichaelwilliams
Last active October 21, 2015 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredmichaelwilliams/d5673f787a53f2be926f to your computer and use it in GitHub Desktop.
Save jaredmichaelwilliams/d5673f787a53f2be926f to your computer and use it in GitHub Desktop.
Time elapsed in minutes and seconds since date on OS X - use with `watch` for updating clock
date1=$(date -j -f "%b %d %T %Z %Y" "Oct 20 21:00:00 EDT 2015" "+%s") date2=$(date +%s) diff=$(($date2-$date1)) ; echo "$(($diff / 60)) minutes and $(($diff % 60)) seconds elapsed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment