title: Remove time from dd/mm/yyyy hh:mm:ss format but removing part of string?
body: <p>I have a date and time in cell C4, in the following format: 01/01/2022 12:30:00
  My main goal is to remove the time and just have the following: 01/01/2022</p>
  <pre><code>var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var daily_data = spreadsheet.getSheetByName(&quot;Daily Data&quot;);
  
  var dateandtime = daily_data.getRange(&quot;C4&quot;).getValue().toString();
  var date = dateandtime.substring(0,10);
  daily_data.getRange(&quot;C4&quot;).setValue(date);
  </code></pre>
  <p>However this just outputs the following: Fri Dec 31</p>