• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calendar class Regarding...

 
Antonio Giovanni
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Please look at the code...



The Result that is showing up is
00:00 when i mention String am_pm="PM";

When i mention String am_pm="AM"; the result showing up is
12:00

THe results are in reverse order !!! What's going wrong... or some kind of a bug !!!..

Please share your comments..

Thanks
 
Dave Wood
bronco
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer lies in the javadoc for Calendar.HOUR:

HOUR

public static final int HOUR

Field number for get and set indicating the hour of the morning or afternoon. HOUR is used for the 12-hour clock (0 - 11). Noon and midnight are represented by 0, not by 12. E.g., at 10:04:15.250 PM the HOUR is 10.
 
Antonio Giovanni
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,

Thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic