title: Java DateTime format for this one
body: <p>What is the Java DateTime format for this one?</p>
  
  <blockquote>
    <p>Mon Nov 26 13:57:03 SGT 2012</p>
  </blockquote>
  
  <p>I want to convert this string to Date and convert it to another format like "yyyy-MM-dd HH:mm:ss".</p>
  
  <p>To convert from date to string is not hard.</p>
  
  <blockquote>
    <p>Format formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");</p>
  </blockquote>
  
  <p>But I find no valid format to convert "Mon Nov 26 13:57:03 SGT 2012" to become date format...</p>
  
  <p>=====</p>
  
  <p>found solution:</p>
  
  <pre><code>DateFormat oldDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
  Format newDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  Date oldDate = oldDateFormat.parse(oldTimeString);
  String newDateString = newDateFormat.format(oldDate);
  </code></pre>