title: How to format Date(Time)Picker value to a date only string?
body: <p>My default date setting in Fiori launchpad is <code>&quot;dd.MM.yyyy, HH:mm&quot;</code>. Whenever I get the date from the date picker placed in view, I am getting the date in the above format.</p>
  <p>Now I want to send this date to backend through <code>ODataModel</code> which generally accepts date in XML date format (e.g. &quot;2014-12-30&quot;). I tried the below code, but it did not work.</p>
  <pre class="lang-js prettyprint-override"><code>var fromDate = this.byId(&quot;fromDate&quot;).getValue(); // &quot;30.12.2014, 10:36&quot;
  var oDateFormat = DateFormat.getDateTimeInstance({ pattern : &quot;yyyy-MM-dd&quot; }); // DateFormat required from &quot;sap/ui/core/format/DateFormat&quot;
  var subFromDate = oDateFormat.format(new Date(fromDate)); // &quot;0NaN-NaN-NaN&quot;. 
  </code></pre>
  <p>When I check in debugger mode, the value in subFromDate is <code>&quot;0NaN-NaN-NaN&quot;</code>. Please provide your valuable suggestions.</p>