From 986159c9a052ac1247b78ed6679b01e2f7db59ac Mon Sep 17 00:00:00 2001
From: Chris Caldwell <chrisolof@gmail.com>
Date: Tue, 13 Aug 2019 09:27:46 -0600
Subject: [PATCH] Fix bug

---
 .../src/SalesforceMappingFieldPluginBase.php           | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php b/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php
index 5a130ef..622f528 100644
--- a/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php
+++ b/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php
@@ -4,6 +4,7 @@ namespace Drupal\salesforce_mapping;
 
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
 use Drupal\Core\Datetime\DateFormatterInterface;
+use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
@@ -200,13 +201,8 @@ abstract class SalesforceMappingFieldPluginBase extends PluginBase implements Sa
 
       case 'date':
       case 'datetime':
-        $tmp = $value;
-        if (!is_int($tmp)) {
-          $tmp = strtotime($tmp);
-        }
-        if (!empty($tmp)) {
-          $value = $this->dateFormatter->format($tmp, 'custom', 'c');
-        }
+        $date = new DrupalDateTime($value, 'UTC');
+        $value = $date->format('Y-m-d\TH:i:s');
         break;
 
       case 'double':
-- 
2.17.1

