'Convert an UTC offset string into a UTC offset value in seconds
@param string: the UTC offset in hours as string, valid formats
are: "+HH:MM", "+HHMM", "+HH" (positive sign can
be omitted), can also recognize decimal notation
with "." as mark'

@staticmethod
def get_offset_value(string):

    if (not string):
        return 0
    sign = 1
    offset_hrs = offset_min = 0
    if isinstance(string, (int, long, float)):
        offset_hrs = string
    elif isinstance(string, basestring):
        if (string[:3] == 'UTC'):
            string = string[3:]
        string = string.strip()
        match = OFFSET.match(string)
        if match:
            groups = match.groups()
            if (groups[0] == '-'):
                sign = (-1)
            offset_hrs = int(groups[1])
            offset_min = int(groups[2])
        elif ('.' not in string):
            try:
                offset_hrs = int(string)
            except ValueError:
                return 0
            if ((offset_hrs < (-99)) or (offset_hrs > 99)):
                if (offset_hrs < 0):
                    sign = (-1)
                (offset_hrs, offset_min) = divmod(abs(offset_hrs), 100)
        else:
            try:
                offset_hrs = float(string)
            except ValueError:
                return 0
    else:
        return 0
    return (sign * ((3600 * offset_hrs) + (60 * offset_min)))
