def parse_relative_time(dtstr):
    # example 600 seconds is: '000000001000000R'

    try:
        year =  int(dtstr[:2])
        month = int(dtstr[2:4])
        day = int(dtstr[4:6])
        hour = int(dtstr[6:8])
        minute = int(dtstr[8:10])
        second = int(dtstr[10:12])
        dsecond = int(dtstr[12:13])

        # According to spec dsecond should be set to 0
        if dsecond != 0:
            raise ValueError("SMPP v3.4 spec violation: tenths of second value is %s instead of 0"% dsecond)
    except __HOLE__, e:
        raise ValueError("Error %s : Unable to parse relative Validity Period %s" % e,dtstr)

    return SMPPRelativeTime(year,month,day,hour,minute,second)
dataset/ETHPy150Open jookies/jasmin/jasmin/vendor/smpp/pdu/smpp_time.py/parse_relative_time