title: Changing the Data Format that is received from the backend in ReactJS
body: <p>I'm currently receiving date from the backend where I'm showing it on the UI.</p>
  <p>These are how the dates look on the backend:</p>
  <p><a href="https://i.stack.imgur.com/gHjPD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gHjPD.png" alt="enter image description here" /></a></p>
  <p>And this is how the date looks when I fetch it on the UI:</p>
  <p><a href="https://i.stack.imgur.com/h8YYG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h8YYG.png" alt="enter image description here" /></a></p>
  <p>As you might have noticed, there is an unnecessary 'T0' which is being shown on the frontend. Is there a way to remove that?</p>
  <p>Here is the code where I'm directly getting the data in my state:</p>
  <pre><code>   class RecNotification extends Component {
      state = {
         clickedDate: this.props.data.status_submit_timestamp,
          ...
     }
  </code></pre>
  <p>And I'm directly showing it on my UI in the return part of the code like this:</p>
  <pre><code>    {
                          this.state.status === true ?
                              &lt;&gt;
                                  &lt;small class=&quot;float-right&quot; style={{ color: '#0d9242' }}&gt;&lt;b&gt;
                                      {this.state.clickedDate}&lt;/b&gt;
                                  &lt;/small&gt;
                                  &lt;small class=&quot;float-right&quot; style={{ color: '#0d9242', marginRight: 3 }}&gt;&lt;b&gt;
                                      Accepted
                                  &lt;/b&gt;&lt;/small&gt;
                              &lt;/&gt;
                              :
                              &lt;&gt;&lt;/&gt;
                      }
  </code></pre>
  <p>I want the date to be like this '2021-04-23 8:30:11' instead of this '2021-04-23T08:30:11'. I want to remove the T0.</p>
  <p><strong>Edit</strong></p>
  <p>Here is the edited code based on Dhaval's and Felipe's answer and it's working now:</p>
  <pre><code>  class RecNotification extends Component {
      state = {
         clickedDate: this.props.data.status_submit_timestamp,
          ...
     }
  
  
     formatedDate = (date) =&gt; {
      return date.charAt(11) === '0' ? date.replace('T0',&quot; &quot;) : date.replace('T',&quot; &quot;);
    };
  
  
     &lt;small class=&quot;float-right&quot; style={{ color: '#dc3545' }}&gt;&lt;b&gt;
                                    {this.formatedDate(this.state.clickedDate)}&lt;/b&gt;
                                  &lt;/small&gt;
                                  &lt;small class=&quot;float-right&quot; style={{ color: '#dc3545', marginRight: 3 }}&gt;&lt;b&gt;
                                      Declined
                                  &lt;/b&gt;&lt;/small&gt;
  </code></pre>