Skip to content

Instantly share code, notes, and snippets.

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):