Skip to content

Instantly share code, notes, and snippets.

@btorch
Created April 10, 2014 14:50
Show Gist options
  • Save btorch/10390451 to your computer and use it in GitHub Desktop.
Save btorch/10390451 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
import time
def get_trans_id_time(trans_id):
if len(trans_id) >= 34 and trans_id[:2] == 'tx' and trans_id[23] == '-':
try:
return int(trans_id[24:34], 16)
except ValueError:
pass
return None
t = get_trans_id_time(sys.argv[1])
print t, time.asctime(time.gmtime(t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment