Code example for TimeZone

Methods: getRawOffset

0
        else  
        { 
            _tzFormat=new SimpleDateFormat(_tzFormatString);
            _minFormat=new SimpleDateFormat(_minFormatString);
        } 
        _tzFormat.setTimeZone(tz);
        _minFormat.setTimeZone(tz);
        _lastSeconds=-1;
        _lastMinutes=-1;        
    } 
 
    /* ------------------------------------------------------------ */ 
    public TimeZone getTimeZone()
    { 
        return _tzFormat.getTimeZone();
    } 
     
    /* ------------------------------------------------------------ */ 
    /** Set the timezone. 
     * @param timeZoneId TimeZoneId the ID of the zone as used by 
     * TimeZone.getTimeZone(id) 
     */ 
    public void setTimeZoneID(String timeZoneId)
    { 
        setTimeZone(TimeZone.getTimeZone(timeZoneId));
    } 
     
    /* ------------------------------------------------------------ */ 
    private void setTzFormatString(final  TimeZone tz )
    { 
        int zIndex = _formatString.indexOf( "ZZZ" );
        if( zIndex >= 0 )
        { 
            String ss1 = _formatString.substring( 0, zIndex );
            String ss2 = _formatString.substring( zIndex+3 );
            int tzOffset = tz.getRawOffset();
             
            StringBuilder sb = new StringBuilder(_formatString.length()+10);
            sb.append(ss1);
            sb.append("'");
            if( tzOffset >= 0 )