• Post Reply Bookmark Topic Watch Topic
  • New Topic

GregorianCalendar or Calender  RSS feed

 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo !

Im have to use a date, i can use GregorianCalendar or Calender, what do Sun recomend that i use, or why use Calender or Why use GregorianCalender ???
As i see it i can do the same things with GregorianCalendar and with Calender ???

Frank Jacobsen

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank,

the answer is:

This usually returns a GregorianCalendar, which represents our (Western) calendar. The calendar object is initialized with the system's time and date. java.util.Calendar is the abstract superclass for calendar objects such as GregorianCalendar. Other calendar's - for example, a Japanese one - may interpret the system's time in another way. However, the only implemented calendar type is the Gregorian one so far.

For more details check the JavaDoc for java.util.Calendar.

Hope this helps.
[ June 25, 2004: Message edited by: Mag Hoehme ]
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seeing as you can't instantiate Calendar (it's an abstract class) there is little to choose...

Effectively you use both together. An instance of GregorianCalendar and static methods and finals from Calendar.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!