from datetime import datetime


def convert_timestamp(ts):
    """ Convert Windows SYSTEMTIME structure to a datatime object """
    return datetime(ts.wYear, ts.wMonth, ts.wDay,
                    ts.wHour, ts.wMinute, ts.wSecond,
                    ts.wMilliseconds * 1000)