• Post Reply Bookmark Topic Watch Topic
  • New Topic

GregorianCalendar  RSS feed

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i get out the year mont and day out from a GregorianCalendar !

I can do this:



But all the methods are deprecated !

Sooooo what schould i do, to do this correct ???

Frank
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading the JavaDoc, for..ohh...a good ten seconds, tells me that there is a get(int field) method avaliable in Gregorian calendar. Reading the deprecation message for Date.get[whatever]() even gives me the correct way to call this method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!