• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dates parsing related  RSS feed

 
srikanth darbha
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a date sch_date_time=01/02/2014 08:00
and when i am doing SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy HH:mm");

date1 = sdf.parse(sch_date_time);

when i am printing date1 it is printing as Wed Jan 01 08:00:00 IST 2014,but it should be printed as Sat Feb 01...

please help me out guys what is the problem?


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at your pattern. "mm" can't mean both minutes and month at the same time, can it?
 
srikanth darbha
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks bear for your quick response yes that is only the problem...

Bear Bibeault wrote:Look at your pattern. "mm" can't be mean both minutes and month at the same time, can it?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!