• Post Reply Bookmark Topic Watch Topic
  • New Topic

Wrong date format  RSS feed

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a problem with a date format:

String s_doom = "24/08/2004 18:24:10";

I need to convert it to the java.Util.date format,
so I do this:

SimpleDateFormat sourceFormat = new SimpleDateFormat("dd/mm/yyyy hh:mm:ss");
Date d_doom = sourceFormat.parse(s_doom);

But if I print it, I get a different value :
System.out.println("d_doom : "+ d_doom);
==> Sat Jan 24 18:24:10 CET 2004

What's going on here ?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: You have "mm" twice in your format string.
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MM = month
mm = minutes

That was a simple and stupid case-sensitive problem ...
Thanks anyway
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!