Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date/SimpleDateFormat help need

 
Sridhar Ranganthan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Iam having a string "02-March-2010" i need to find the specified string belongs to which format.

can any one help me how to write the Progarm ? Based on the input it should show the proper date format

output required :- dd-MMM-yyyy
Thanks
 
Smitesh Shinde
Ranch Hand
Posts: 45
Firefox Browser Java
 
Sridhar Ranganthan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is not really help me....

Thanks,
Sri.R
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sridhar Ranganthan wrote:This is not really help me....

Sridhar, the link provided by Smitesh has a lot of examples. Is there anything particular that you didn't understand in it?

Also, show us what you have done so far, let us know if you are stuck somewhere and we'll try to help. Please show some effort.
 
Thiagu Sin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pushkar Choudhary wrote:
Sridhar Ranganthan wrote:This is not really help me....

Sridhar, the link provided by Smitesh has a lot of examples. Is there anything particular that you didn't understand in it?

Also, show us what you have done so far, let us know if you are stuck somewhere and we'll try to help. Please show some effort.


Actually the link that Smitesh sent is about how to format a date in different forms but what Shridhar is asking is, when you get an input of date as String how are you going to identify the Pattern used by the String to format the date. Which is something that I have never come acrossed before.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's because there are potentially limitless possibilities. There are a fixed number of field identifiers, but each can be multiplied indefinitely.
 
Thiagu Sin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:That's because there are potentially limitless possibilities. There are a fixed number of field identifiers, but each can be multiplied indefinitely.


Ya true Rob, I don't know how Shridar is going to come up with an algorithm to identify the pattern, as you said the possibilities are limitless.
 
Sridhar Ranganthan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is not possible means, please help me
how to format the date with specified fomat

having a string array



I need to format the string[] value with specified format, i tried with SimpleDateFormat also , its not coming properly
please any one help me program.

Thanks,
Sridhar.R

 
Muneeswaran Balasubramanian
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sri,
You use the date format as "dd/mm/yyyy".Its just wrong.You have used MM for denote the month.
Change the format dd/MM/yyyy insted of dd/mm/yyyy.

I hope you will got your desired result.

Cheers Munees.
MyBlog
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic