public static SimpleTimeZone getCustomTimeZone ( int offset ) { boolean negative = false ; int tmp = offset ; if ( offset < 0 ) { negative = true ; tmp = - offset ; } int hour , min , sec ; if ( ASSERT ) { Assert . assrt ( "millis!=0" , tmp % 1000 != 0 ) ; } tmp /= 1000 ; sec = tmp % 60 ; tmp /= 60 ; min = tmp % 60 ; hour = tmp / 60 ; // Note: No millisecond part included in TZID for now String zid = formatCustomID ( hour , min , sec , negative ) ; return new SimpleTimeZone ( offset , zid ) ; }
Creates a custom zone for the offset