Created
November 2, 2017 09:58
-
-
Save Songmu/83e2cd0ebff685f1ae0fa70f5987d63b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# snow.bash $(date +%s) | |
set -e | |
epoch=$1 | |
if ! [[ $epoch =~ ^([0-9]+)$ ]]; then | |
echo 'Error: valid epoch required' | |
echo "Usage: $0 \$epoch" | |
exit 1 | |
fi | |
echo $(($(expr $epoch \* 1000 - 1288834974657) << 22)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment