title: How to show only date in DateTimePicker in react native
body: <p>I am new to react native. I have created a screen where I am showing date . and I am using DateTimePicker in react native. But the problem is I only want to show date like this =&gt; &quot;fri jun 12 2020&quot; or 6 jun 2020 or 6/6/2020 or 6-6-2020. but I am getting date like this.=&gt; Fri Jun 12 2020 05:30:00 GMT+0530(IST). so please help. thanks. In short I dont want display Time</p>
  <p>here is my code</p>
  <pre><code>&lt;DateTimePicker 
     value={date}           
     mode={mode}
     is24Hour={false}
     display=&quot;default&quot; 
     onChange={this.setDate} 
  /&gt;
  
  &lt;Text style={{fontSize: 18}}&gt;{String(this.state.dateString)}&lt;/Text&gt;
  </code></pre>
  <p>here is my code of onChange . I am getting undefined instead of date = &gt;</p>
  <pre><code>setDate = (event,  selectedDate) =&gt; {
  
      const year = selectedDate.getFullYear();
      const  month = selectedDate.getMonth(); 
      const  day= selectedDate.getDate();
    
      const  dateString = `${day}-${month}-${year}`;
      this.setState({date: selectedDate})
      this.setState({dateString: dateString})
  
   }
  </code></pre>