title: Convert a String with GMT to DateTime Format - php
body: <p>I face this problem to integrate bKash Online Payment Gateway API. 
  The Documentation is here - <a href="https://developer.bka.sh/docs/create-payment-1" rel="nofollow noreferrer">https://developer.bka.sh/docs/create-payment-1</a>.</p>
  
  <p>In 'Create Payment' section bKash return <em>paymentCreateTime</em> string as following format.</p>
  
  <pre><code>2020-01-07T11:55:34:438 GMT+0600
  </code></pre>
  
  <p>How can I convert it to <code>2020-01-07 11:55:34</code> to save in MySQL?</p>
  
  <p>I find a solution like following way. </p>
  
  <pre><code>$input     = "2020-01-07T11:55:34:438 GMT+0600"                   // "2020-01-07T11:55:34:438 GMT+0600"
  $timestamp = substr($input,0,19);                                 // "2020-01-07T11:55:34"
  $mysql     = date_format(date_create($timestamp),'Y-m-d H:i:s');  // "2020-01-07 11:55:34"
  </code></pre>
  
  <p>But I need a solution without <code>substr()</code> function.</p>