• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date method behavior  RSS feed

 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
I have below code,

ouput is as below,


I am parsing 12:30 and adding that time with the current time, as I am giving a 12:30 then after appying this time with current date it should have time 12:30 but having time of midnight i.e. 00:30.
How can I avoid of parsing to a mid night time instead of noon time.

Thanks,
Shailesh Narkhede.
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got solution myself after going through javadoc for SimpleDateFormat

need to change hh to HH in SimpleDateFormat then it works.




 
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, that's right. Thanks for sharing the solution!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!