Skip to content

Commit

Permalink
Millisecond timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
za3k committed Jun 8, 2024
1 parent cbe8543 commit 7d48f21
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion unix2date
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
#!/bin/sh
exec \date -d "1970-01-01 $1 sec UTC"
TS="$1"

case $TS in
?????????????)
exec \date -d "1970-01-01 $((TS / 1000)) sec UTC"
;;
??????????)
exec \date -d "1970-01-01 $TS sec UTC"
;;
esac

0 comments on commit 7d48f21

Please sign in to comment.