Add time2unix and unix2time shell scripts

This commit is contained in:
Doncho N. Gunchev 2011-12-02 06:00:44 +02:00
parent e4341d2a3d
commit 70bed2a4d4
2 changed files with 14 additions and 0 deletions

8
time/time2unix Executable file
View file

@ -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"

6
time/unix2time Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
ut="${1:-0}"
ht="$(date -d "@$ut")"
echo "Unix Time : $ut"
echo "Human Time: $ht"