title: How to save custom datetime in cakephp 3 for created & modified field?
body: <p>I'm trying to save the following data. But it's not saving the datetime fields.
  Created is saving current datetime in cakephp way &amp; the others are null.</p>
  
  <p>How can I save custom datetime?</p>
  
  <p>Thanks in advance</p>
  
  <pre><code>foreach ($passwords as $key =&gt; $value ) {
      $data['id']             = $collection_id;
      $data['name']           = $value['password'];
      $data['collection_id']  = $collection_id;
      $data['photo_count']    = $value['photos_count'];
      $data['download_count'] = $value['downloaded_users_count'];
      $data['created']        = $value['created'];
      $data['modified']       = $value['modified'];
      $data['expires_at'] = $value['expires_at'];
      $saveData[] = $data;
  }
  
  $passwords = $this-&gt;Passwords-&gt;find('all')-&gt;toArray();
  $patched = $this-&gt;Passwords-&gt;patchEntities($passwords, $saveData);
  foreach ($patched as $entity) {
      $this-&gt;Passwords-&gt;save($entity);
  }
  </code></pre>