Avoid SQL error with wrong formatted datetime value
authorMichael <heluecht@pirati.ca>
Thu, 3 May 2018 20:48:35 +0000 (20:48 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 3 May 2018 20:48:35 +0000 (20:48 +0000)
src/Worker/OnePoll.php

index aa3eabf..e42612c 100644 (file)
@@ -78,7 +78,7 @@ class OnePoll
                                        $last_updated = $contact['last-item'];
                                }
 
-                               $fields = ['last-item' => $last_updated, 'last-update' => $updated, 'success_update' => $updated];
+                               $fields = ['last-item' => DateTimeFormat::utc($last_updated), 'last-update' => $updated, 'success_update' => $updated];
                                self::updateContact($contact, $fields);
                                Contact::unmarkForArchival($contact);
                        } else {