Field type date bad formatting i have a strange issue with a field "date".
First i save it programatically this way : 

$now = new \DateTime();
$node-&gt;set('field_paiement_date' =&gt; DrupalDateTime::createFromTimestamp($now-&gt;getTimestamp());
$node-&gt;save();


Then when i come on the content type in the back office i've got this value :

And finally when i dump the field in question i got this value : 

My current timezone is 'Pacific/Noumea', so the correct value i want to show to the users is the one when i dump the field. What is the best way to do that ?

Regards,
Datetime values in storage are UTC, if you are storing datetime values by your own, you have to pay attention on this and display datetimes to users considering your timezone ('Pacific/Noumea' probably declared in your php.ini or user's timezone present in user profile).

Storing 2018-05-02T08:23:25 as your current datetime in caledonia in database is a nonsense considering timezone, because the format DateTimeItemInterface::DATETIME_STORAGE_FORMAT do not include timezone.

$date = strtotime($node-&gt;field_paiement_date-&gt;value);
\Drupal::service('date.formatter')
  -&gt;format($date, 'custom', 'Y-m-d H:i:s', drupal_get_user_timezone());
\Drupal::service('date.formatter')
  -&gt;format($date, 'custom', 'Y-m-d H:i:s', 'Pacific/Noumea');