title: How to change ngbDatepicker date format from JSON to YYYY/MM/DD
body: <p>I'm working with ngbDatepicker this is giving me JSON date format like:</p>
  
  <pre><code>{ year: 2019, month: 6, day: 9 }
  </code></pre>
  
  <p>How can I convert this into YYYY/MM/DD? 
  I'm using Angular 7.</p>
  
  <p>My Code is as below:</p>
  
  <pre><code>&lt;div class="input-group"&gt;
     &lt;input class="form-control" placeholder="YYYY-MM-DD"
            (click)="d2.toggle()" (ngModelChange)="onDateSelection($event,'ToDate');"  name="d2" #c2="ngModel" [(ngModel)]="toDate" ngbDatepicker #d2="ngbDatepicker"&gt;
           &lt;div class="input-group-append"&gt;
            &lt;button class="btn btn-outline-secondar" 
               (click)="d2.toggle()" type="button"&gt;
             &lt;i class="fa fa-calendar" aria-hidden="true"&gt;&lt;/i&gt;
            &lt;/button&gt;
           &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>