The i18n Cookbook - recipies for a global society

  • java cookbook
  • about the author
Home

Java Cookbook

  • Java Internationalization Cookbook

gregorian

Gregorian Calendar

Problem:

You want to create a standard calendar as used in the west.

Solution:

The Gregorian Calendar is the predominant calendar of western countries today. To create a new Gregorian Calendar call the Singleton getInstance method on the Calendar class. if you specify a Locale as an argument the Calendar returned will reflect the first day of the week etc. of the Locale.

Locale locale = new Locale("en","US");
Calendar calendar = Calendar.getInstance(locale);

 

  • calendar
  • gregorian
  • Add new comment

If you are testing any of these recipes in Eclipse and the characters are not displaying correctly in your console visit http://i18ncookbook.com/eclipse_settings.

This site is ad supported.  I hope you find something among our sponsors worth clicking. ;)

i18n search

Google
Custom Search
Syndicate content

Search

Tags in Tags

calendar date icu4j Java Locale number format numberformat parse spellout timezone transliteration transliterator
more tags

User login

  • Create new account
  • Request new password
  • java cookbook
  • about the author