Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference in Date Calendar classes  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explain the difference between the Date, Calendar and GregorianCalendar? I'm not sure how each is used.

Thanks.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Date represents a specific point in time.

Calendar is an abstract class that defines methods for converting, comparing or manipulating points in time.

GregorianCalendar extends Calendar and implements the logic necessary for converting, comparing or manipulating dates according to the calendar created by Pope Gregory XIII.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!