title: Python: convert datetime format to another
body: <p>So i have this kind f format:</p>
  
  <pre><code>'%Y-%m-%d %H:%M:%S.%f'
  
  date_time = datetime.now()
  </code></pre>
  
  <p><strong>Ouput</strong></p>
  
  <pre><code>'2019-04-15 07:52:14.211697'
  </code></pre>
  
  <p>And i want to change is into this format: <code>'%Y-%m-%d %H:%M:%S,%f'</code></p>
  
  <p>This is what i have try:</p>
  
  <pre><code>time = datetime.strptime(str(date_time), '%Y-%m-%d %H:%M:%S,%f')
  </code></pre>
  
  <p>And this is the <code>error</code>:</p>
  
  <blockquote>
    <p>ValueError: time data '2019-04-15 07:52:14.211697' does not match
    format '%Y-%m-%d %H:%M:%S,%f'</p>
  </blockquote>
  
  <p><strong>Edit</strong></p>
  
  <p>So i have this <code>string</code>:</p>
  
  <pre><code>    maches = regex.findall(
          '[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1]) (?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9],[0-9][0-9][0-9]',
          line)
  
  match[0] = '2019-03-13 17:35:35,855'
  </code></pre>
  
  <p>And i want to convert it to <code>Datetime</code>:</p>
  
  <pre><code>time = datetime.strptime(maches[0], '%Y-%m-%d %H:%M:%S,%f')
  </code></pre>
  
  <p>And this returned another <code>format</code>:</p>
  
  <pre><code>2019-03-13 17:35:35.855000
  </code></pre>
  
  <p>Why ?</p>