'Return RDFDatetime from string like 20140825162259.000000-420.
Args:
timestr: WMI time string
Returns:
rdfvalue.RDFDatetime
We have some timezone manipulation work to do here because the UTC offset is
in minutes rather than +-HHMM'

def WMITimeStrToRDFDatetime(self, timestr):

    offset_minutes = timestr[21:]
    year = timestr[:4]
    month = timestr[4:6]
    day = timestr[6:8]
    hours = timestr[8:10]
    minutes = timestr[10:12]
    seconds = timestr[12:14]
    microseconds = timestr[15:21]
    unix_seconds = calendar.timegm(map(int, [year, month, day, hours, minutes, seconds]))
    unix_seconds -= (int(offset_minutes) * 60)
    return rdfvalue.RDFDatetime(((unix_seconds * 1000000.0) + int(microseconds)))
