diff --git a/time/time2unix b/time/time2unix new file mode 100755 index 0000000..18977c8 --- /dev/null +++ b/time/time2unix @@ -0,0 +1,8 @@ +#!/bin/bash + +ht="${1:-now}" +ut="$(date '+%s' -d "$ht")" +echo "Human Time: $ht" +echo "Unix Time : $ut" +ht="$(date -d "@$ut")" +echo "Human Time: $ht" diff --git a/time/unix2time b/time/unix2time new file mode 100755 index 0000000..dea031f --- /dev/null +++ b/time/unix2time @@ -0,0 +1,6 @@ +#!/bin/bash + +ut="${1:-0}" +ht="$(date -d "@$ut")" +echo "Unix Time : $ut" +echo "Human Time: $ht"