timezone

Posted kakaisgood

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了timezone相关的知识,希望对你有一定的参考价值。

        Calendar cal2 = Calendar.getInstance(); 
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); 
        sdf.setTimeZone(TimeZone.getTimeZone("Asia/Dubai"));
        String wsSysTime2  = sdf.format(cal2.getTime());
        System.out.println("END   TIME ..." + wsSysTime2);  
        
        
        System.out.println(java.util.TimeZone.getDefault().getID());
        
        TimeZone tz = TimeZone.getTimeZone("Poland"); 
        
        for(String str: tz.getAvailableIDs())
            System.out.println(str);
        
        System.out.println(tz.getID());
        System.out.println(tz.getDSTSavings());
        System.out.println(tz.getDisplayName());
        System.out.println(tz);
        
        System.out.println(TimeZone.getTimeZone("Europe/London").useDaylightTime());
        System.out.println(TimeZone.getTimeZone("Asia/Dubai").useDaylightTime());
        System.out.println(TimeZone.getTimeZone("Asia/Bahrain").useDaylightTime());
        System.out.println(TimeZone.getTimeZone("Poland").useDaylightTime());
        System.out.println(TimeZone.getTimeZone("Europe/Moscow").useDaylightTime()); 
    

 

以上是关于timezone的主要内容,如果未能解决你的问题,请参考以下文章