Java Calendar getTimeZone方法


Java Calendar getTimeZone方法

package com.codingdict;

import java.util.*;

public class CalendarDemo {
   public static void main(String[] args) {

      // create a calendar
      Calendar cal = Calendar.getInstance();

      // get the time zone
      TimeZone tz = cal.getTimeZone();

      // print the time zone name for this calendar
      System.out.println("The time zone is :" + tz.getDisplayName());
   }
}