title: How to convert String of datetime to date using GWT?
body: <p>In mysql, i have a field time_entered of type datetime (sample data: 2012-06-20 16:00:47). I also have a method, getTimeEntered(), that returns the value as String. I want to display the date in this format 2012-06-20 using DateTimeFormat from GWT.</p>
  
  <p>here's my code:</p>
  
  <pre><code>String date = aprHeaderDW.getTimeEntered();
  DateTimeFormat fmt = DateTimeFormat.getFormat("MM-dd-yyyy");
  dateEntered.setText("" + fmt.format(date));
  </code></pre>
  
  <p>The problem is, the format method doesn't accept arguments as String. So if there's only a way I could convert the date from String to Date type, it could probably work. I tried typecasting but didn't work.</p>