Skip to content

Instantly share code, notes, and snippets.

@abraithwaite
Created May 19, 2016 20:29
Show Gist options
  • Save abraithwaite/7c83fe3c31756ef890c876d9e9554065 to your computer and use it in GitHub Desktop.
Save abraithwaite/7c83fe3c31756ef890c876d9e9554065 to your computer and use it in GitHub Desktop.
function u2d () {
if [[ $# > 0 ]]; then
date -u -Iseconds -d @$1
else
date -u -Iseconds
fi
}
function d2u () {
if [[ $# > 0 ]]; then
date -u -d $1 +%s
else
date -u +%s
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment