Code example for TimeZone

Methods: getOffset

0
                    City c1 = (City)o1;
                    City c2 = (City)o2;
                    TimeZone tz1 = c1.getTimeZone();
                    TimeZone tz2 = c2.getTimeZone();
                    int off1 = tz1.getOffset(now);
                    int off2 = tz2.getOffset(now);
                    if (off1 == off2) {
                        float dlat = c2.getLatitude() - c1.getLatitude();
                        if (dlat < 0.0f) return -1;
                        if (dlat > 0.0f) return 1;
                        return 0; 
                    } 
                    return off1 - off2;
                } 
            }); 
        return ocities;
    } 
     
     
    /**