public static void setTimeZone ( final SimpleDateFormat fmt , final String tzname ) { if ( tzname == null ) { return ; // Use the default timezone. } final TimeZone tz = DateTime . timezones . get ( tzname ) ; if ( tz != null ) { fmt . setTimeZone ( tz ) ; } else { throw new IllegalArgumentException ( "Invalid timezone name: " + tzname ) ; } }
Applies the given timezone to the given date format .