aboutsummaryrefslogtreecommitdiff
path: root/bin/bin/epoch
blob: ba45b0234cfe5164a186e85d135d933068180af2 (plain)
1
2
3
4
5
6
7
8
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" "$@"