Fan.Sys.DateTimeStr.parseTzOffset C# (CSharp) Method

parseTzOffset() private method

private parseTzOffset ( ) : void
return void
        private void parseTzOffset()
        {
            int ch = str[pos++];
              bool neg;
              switch (ch)
              {
            case '-': neg = true; break;
            case '+': neg = false; break;
            case 'Z': tzOffset = 0; return;
            default: throw new Exception();
              }

              int hr = parseInt(1);
              int min = 0;

              if (pos < str.Length)
              {
            ch = str[pos];
            if (ch == ':')
            {
              pos++;
              min = parseInt(1);
            }
            else if ('0' <= ch && ch <= '9')
            {
              min = parseInt(1);
            }
              }
              tzOffset = hr*3600 + min*60;
              if (neg) tzOffset = -tzOffset;
        }