title: DateTime from PHP to Java (Android): how to convert a string to a DateTime object?
body: <p>In PHP to convert a string to DateTime() its very very easy:</p>
  
  <pre><code>$dateTime = new DateTime("2013-12-11 10:109:08");
  echo $dateTime-&gt;format("d/m/Y"); // output 11/12/2013
  </code></pre>
  
  <p>What is the equivalent in Java? I've seen a lot of questions in stackoverflow. I cant find a way to solve this problem.</p>
  
  <p>My last try is:</p>
  
  <pre><code>SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm", Locale.ITALIAN);
  return dateFormat.format(new Date(datetime)).toString();
  </code></pre>
  
  <p>This crash application. Android Studio tells me that Date(java.lang.String) is deprecated.</p>
  
  <p>Can someone help me?</p>