As I am not expert in handling of dates in java but I am unable to understand this behaviour.
Here is my code
Date from = new SimpleDateFormat("dd/MM/yyyy").parse("05/07/2013");
System.out.println(from);
which gave me this output
Sat Jul 05 00:07:00 PKT 2013
And this is 2nd another code snippet
Date from = new SimpleDateFormat("dd/mm/yyyy").parse("05/07/2013");
System.out.println(from);
which gave me this output:
Sat Jan 05 00:07:00 PKT 2013
Now the thing which is considerable is format.
This format dd/MM/yyyy
which have MM
gave me correct output but this format dd/mm/yyyy
which have small mm
gave me wrong output (always give jan
in month).I read the doc where it is mentioned that samll m is for minutes and capital M is for month
My question is Can I never use small m here? if no , then why it is giving the result and on which basis it is giving jan
everytime
I know this is a basic question but after searching and after not finding any understandable thing , I posted it.Thanks