Set locale and TimeZone for Gregorian Calendar in Java
Description
The following code shows how to set locale and TimeZone for Gregorian Calendar.
Example
/* w ww. j a v a 2s . c o m*/
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
public class Main {
public static void main(String[] a) {
GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("America/Chicago"),
Locale.US);
System.out.println(calendar);
}
}
The code above generates the following result.