Skip to content

Instantly share code, notes, and snippets.

Created May 27, 2020 21:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#!/usr/bin/env python3
import argparse
import sys
parser = argparse.ArgumentParser(description="Process some integers.")
args = parser.parse_args()
print(f"Processing {}")
if len( % 3 != 0:
print("Should be a multiple of 3.")
if len( != 39:
f"Should be 39 characters long, excluding the escape slashes: {len(}"
parts = [[i : i + 3] for i in range(0, len(, 3)]
data = [int(n, base=8).to_bytes(1, byteorder="little") for n in parts]
year = f"{int(data[0])}{int(data[1])}"
month = f"{int(data[2])}{int(data[3])}"
day = f"{int(data[4])}{int(data[5])}"
hour = f"{int(data[6])}{int(data[7])}"
minute = f"{int(data[8])}{int(data[9])}"
second = f"{int(data[10])}{int(data[11])}"
tz = f"{data[12].decode('utf-8')}"
print(f"20{year}/{month}/{day} {hour}:{minute}:{second} {tz}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment