Java TimeZone Format resolveTimeZone(SimpleDateFormat sdf, String timezone)

Here you can find the source of resolveTimeZone(SimpleDateFormat sdf, String timezone)

Description

Wrap TimeZone.getTimeZone so that reflection doesn't need to look for sun.util.calendar.ZoneInfo which causes warnings in some environments

License

Apache License

Declaration

public static void resolveTimeZone(SimpleDateFormat sdf, String timezone) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.TimeZone;
import java.text.SimpleDateFormat;

public class Main {
    /**/*from w  w w  . jav  a  2 s.com*/
     * Wrap TimeZone.getTimeZone so that reflection doesn't need to look for
     * sun.util.calendar.ZoneInfo which causes warnings in some environments
     */
    public static void resolveTimeZone(SimpleDateFormat sdf, String timezone) {
        sdf.setTimeZone(TimeZone.getTimeZone(timezone));
    }
}

Related

  1. getTimeByZoneAndFormat(Date date, TimeZone zone, String format)
  2. getTimeWithFormat(String stringDate, String dateFormat, DateTimeZone timeZone, Locale locale)
  3. getTimezoneFormattedString(Date date, String timezone)
  4. getUserToServerDateTimeString(TimeZone timeZone, int dateFormat, int timeFormat, String date)
  5. getZfgcTimeZoneDateFormat(String timezone)
  6. String2Date(String date, String formatPattern, Locale locale, TimeZone timeZone)
  7. string2Timezone(String srcFormater, String srcDateTime, String dstFormater, String dstTimeZoneId)
  8. toAPITimeString(Date date, String format, String timeZone)
  9. toTimeFormat(String timeFormat, TimeZone tz, Locale locale)