1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import time
- from datetime import datetime, timedelta, timezone
- def main():
- '''
- seconds = time.time()
- print(int(seconds))
- # Local time
- local_time = time.ctime(time.time())
- print(type(local_time))
- print(local_time)
- print(time.localtime())
- '''
- '''
- print(timezone.utc)
- d = datetime.now(timezone.utc).astimezone()
- print(d)
- utc_offset = d.utcoffset() // timedelta(seconds=1)
- print(utc_offset)
- '''
-
- print(f'RTC: {time.ctime(1722011409)}. Unix time stamp:')
- model = "MDIO-88"
- # model_bytes = bytearray()
- model_bytes = model.ljust(16, '\n').encode('ascii')
- for i in model:
- print(hex(ord(i)))
- # model_bytes.append(ord(i))
- # model_bytes += ord(i)
- print(model)
- print(model_bytes)
- if __name__ == '__main__':
- main()
|