| Author |
SimpleDateFormat not returning expectec output?
|
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
Hi all, I am converting string to date . following is my code but it is not returning expected output.
and it returns output as :
Converted date isThu Jan 20 16:11:00 IST 2011
But I think output must be as
Converted date isThu Jun 20 16:11:00 IST 2011
Why it shows month as Jan instead of Jun?
|
Life is easy because we write the source code.....
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4164
|
|
|
Read the API more closely. What's the format symbol for a two digit month? (Hint: it isn't "mm")
|
luck, db
There are no new questions, but there may be new answers.
|
 |
joy b chakravarty
Ranch Hand
Joined: May 16, 2011
Posts: 62
|
|
you've used 'mm' for both minutes and month
'MM' stands for month and 'mm' stands for minutes
|
Cheers, Joy [SCJP 1.4, SCBCD 5.0]
get high on alcohol, algorithm or both
|
 |
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
|
Oh ! Thanks Darryl Burke . Its MM instead of mm. Thanks again.
|
 |
Pramod P Deore
Ranch Hand
Joined: Jul 15, 2008
Posts: 629
|
|
Thanks joy b chakravarty
|
 |
 |
|
|
subject: SimpleDateFormat not returning expectec output?
|
|
|