diff options
author | xero <x@xero.nu> | 2015-11-01 15:40:55 -0500 |
---|---|---|
committer | xero <x@xero.nu> | 2015-11-01 15:40:55 -0500 |
commit | d83a172950d90861d63b3891b14d5106e710502d (patch) | |
tree | 1da5c1e7ed2324e37508f5e817d5d768d8d486b8 /bin/bin/epoch | |
parent | c9794fec6f9c9bb5ffbf0666d81bc167cc3273e3 (diff) | |
download | dotfiles_ascii-d83a172950d90861d63b3891b14d5106e710502d.tar.xz dotfiles_ascii-d83a172950d90861d63b3891b14d5106e710502d.zip |
use ~/bin like a civilized nixer
Diffstat (limited to 'bin/bin/epoch')
-rwxr-xr-x | bin/bin/epoch | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/bin/epoch b/bin/bin/epoch new file mode 100755 index 0000000..ba45b02 --- /dev/null +++ b/bin/bin/epoch @@ -0,0 +1,9 @@ +#!/bin/bash + +# get seconds since epoch +test "x$1" == x && date +%s && exit 0 + +# or convert epoch seconds to date format (see "man date" for options) +EPOCH="$1" +shift +date -d @"$EPOCH" "$@" |