title: Why am I unable to convert Datetime to the required format
body: <p>This is the requirement</p>
  
  <p>I am having my field declared in my class file as Datetime.</p>
  
  <p>I am taking a string and i would like to convert it to Datetime as my filed in my class is in date time</p>
  
  <p>I always pass it as </p>
  
  <pre><code>    String date="9999-12-31 00:00:00"
  </code></pre>
  
  <p>I would like to convert this to date time so that the output format should be the same as the given string</p>