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 datetime | |
FILE_TIME_EPOCH = datetime.datetime(1601, 1, 1) | |
FILE_TIME_MICROSECOND = 10 # FILETIME counts 100 nanoseconds intervals = 0.1 microseconds, so 10 of those are 1 microsecond | |
def convert_from_file_time(file_time): | |
microseconds_since_file_time_epoch = file_time // FILE_TIME_MICROSECOND | |
return FILE_TIME_EPOCH + datetime.timedelta(microseconds=microseconds_since_file_time_epoch) | |
def convert_to_file_time(date_time): |