This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import iso8601 | |
| import datetime | |
| import calendar | |
| # convert iso8601 format to timestamp | |
| t1 = iso8601.parse_date('2018-04-26T01:53:40+08:00').astimezone(datetime.timezone.utc) | |
| calendar.timegm(t1.timetuple()) | |
| # convert timestamp to iso8601 format | |
| t2 = datetime.datetime.fromtimestamp(int("1524678820")).astimezone(datetime.timezone.utc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ctypes, sys | |
| from ctypes import windll, wintypes | |
| from uuid import UUID | |
| class GUID(ctypes.Structure): # [1] | |
| _fields_ = [ | |
| ("Data1", wintypes.DWORD), | |
| ("Data2", wintypes.WORD), | |
| ("Data3", wintypes.WORD), | |
| ("Data4", wintypes.BYTE * 8) |