add unixtime, jwtoken
This commit is contained in:
14
utime2date.py
Executable file
14
utime2date.py
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
unixt = (sys.argv[1])
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
ts = int(unixt)
|
||||
|
||||
# if you encounter a "year is out of range" error the timestamp
|
||||
# may be in milliseconds, try `ts /= 1000` in that case
|
||||
print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
|
||||
Reference in New Issue
Block a user