Words
63
Reading
1 min
Listen
Play
4y
Convert from HyperTime to other time formats
def convert_to_time(hypertime):
year = int(hypertime[:4])
month_day = int(hypertime[4:8])
hour_minute = int(hypertime[9:11])
second = int(hypertime[12:])
return time.struct_time((year, month_day, hour_minute, second))
Convert from other time formats to HyperTime
def convert_from_time(time):
year = str(time.tm_year).zfill(4)
month_day = str(time.tm_mon).zfill(2) + str(time.tm_mday).zfill(2)
hour_minute = str(time.tm_hour).zfill(2) + str(time.tm_min).zfill(2)
second = str(time.tm_sec).zfill(2)
return year + month_day + '-' + hour_minute + '-' + second
RE: Cavalier Freedom Robot named DAN Invents new Compu-Time System "HyperTime".