Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@uu59
Created February 3, 2012 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uu59/1730165 to your computer and use it in GitHub Desktop.
Save uu59/1730165 to your computer and use it in GitHub Desktop.
#!/bin/bash
# https://gist.github.com/634586
ID=$1
if [ -z "$ID" ];then
echo "Usage: ${0} [snowflake id]"
exit 0
fi
EPOCH=1288834974657
TIME=$(($(($((ID>>22)) + $EPOCH)) / 1000))
date -d @$TIME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment