Calendar properties
In this chapter you will learn:
Lenient date/time
boolean isLenient()
tells whether date/time interpretation is to be lenient.
import java.util.Calendar;
/* j a v a2 s .com*/
public class Main{
public static void main(String[] argv){
System.out.println(Calendar.getInstance().isLenient());
}
}
The output:
Get the available locales
static Locale[] getAvailableLocales()
returns an array of all locales for which the getInstance methods of this class can return localized instances.
The following code displays all locales from Calendar class:
import java.util.Calendar;
import java.util.Locale;
/*from ja v a 2 s. c o m*/
public class Main{
public static void main(String[] argv){
Locale[] locales = Calendar.getAvailableLocales();
for(Locale l: locales){
System.out.println(l.getDisplayCountry());
}
}
}
The output:
Next chapter...
What you will learn in the next chapter:
Home » Java Tutorial » Date, Time, Calendar, TimeZone