Java Calendar getInstance 方法区域设置


Java Calendar getInstance 方法区域设置

package com.codingdict;

import java.util.*;

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

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

      // print the date for canada
      System.out.println("Date And Time in Canada Is: " + cal.getTime());
   }
}