Forums Register Login

Date/SimpleDateFormat help need

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Hi,

This is not really help me....

Thanks,
Sri.R
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
That's because there are potentially limitless possibilities. There are a fixed number of field identifiers, but each can be multiplied indefinitely.
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
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

+Pie Number of slices to send: Send
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
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1421 times.
Similar Threads
issue with datetimepicker & autocompleter in struts 2
simple date format question
Output a Calendar with timezone, in W3C datetime format?
Conversion of String to Date
JDBC SQL server date format problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:07:25.