File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Date/SimpleDateFormat help need Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Date/SimpleDateFormat help need" Watch "Date/SimpleDateFormat help need" New topic
Author

Date/SimpleDateFormat help need

Sridhar Ranganthan
Ranch Hand

Joined: Mar 12, 2009
Posts: 35
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

Joined: Feb 16, 2008
Posts: 45

May be this can help

http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/
Sridhar Ranganthan
Ranch Hand

Joined: Mar 12, 2009
Posts: 35
Hi,

This is not really help me....

Thanks,
Sri.R
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

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

Joined: Jan 10, 2009
Posts: 13
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

Joined: Oct 27, 2005
Posts: 19755
    
  20

That's because there are potentially limitless possibilities. There are a fixed number of field identifiers, but each can be multiplied indefinitely.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Thiagu Sin
Greenhorn

Joined: Jan 10, 2009
Posts: 13
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

Joined: Mar 12, 2009
Posts: 35
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

Joined: Mar 19, 2010
Posts: 138
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


Cheers Munees
My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date/SimpleDateFormat help need