title: How to get the given date string format(pattern) in java?
body: <p>I want to get the format of a given date string. </p>
  
  <p>Example: I have a string like <code>2011-09-27T07:04:21.97-05:00</code> and the date format of this string is <code>yyyy-MM-dd'T'HH:mm:ss.SSS</code>. </p>
  
  <p>Here I want to find out this date format when I pass string(<code>2011-09-27T07:04:21.97-05:00</code>) to a method which will return the format(<code>yyyy-MM-dd'T'HH:mm:ss.SSS</code>), then later I will format my given date string according to my requirement(<code>like yy-mm--dd or mm/dd/yyyy</code>).</p>
  
  <p>Can any one tell me how can I get it achieved?</p>