• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Date/SimpleDateFormat help need

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be this can help

http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/
 
Sridhar Ranganthan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This is not really help me....

Thanks,
Sri.R
 
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic