Skip to content

Instantly share code, notes, and snippets.

@Songmu
Created November 2, 2017 09:58
Show Gist options
  • Save Songmu/83e2cd0ebff685f1ae0fa70f5987d63b to your computer and use it in GitHub Desktop.
Save Songmu/83e2cd0ebff685f1ae0fa70f5987d63b to your computer and use it in GitHub Desktop.
#!/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