mirror of
https://github.com/gunchev/home_bin.git
synced 2025-11-20 12:15:46 +00:00
Add time2unix and unix2time shell scripts
This commit is contained in:
parent
e4341d2a3d
commit
70bed2a4d4
2 changed files with 14 additions and 0 deletions
8
time/time2unix
Executable file
8
time/time2unix
Executable 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
6
time/unix2time
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ut="${1:-0}"
|
||||||
|
ht="$(date -d "@$ut")"
|
||||||
|
echo "Unix Time : $ut"
|
||||||
|
echo "Human Time: $ht"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue