Convert UTC to local time in date field I have a content type with a date field, which I convert to a specific date format in a preprocess function:

$variables['date'] =
\Drupal::service('date.formatter')-&gt;format($variables['node']-&gt;field_datum-&gt;date-&gt;getTimestamp(), 'long_date_without_time');


But as Germany is one hour ahead, a date like 2015-03-31 23:01:08 UTC converts to 1. April 2015. How can I convert this to our local time?

EDIT: I already set the correct timezone in the UI. And I just saw that the wrong dates are only shown when I set my system time between 11pm and 1 am...
The date formatter service automatically converts it to whatever time zone you selected when you installed the Drupal site, admin/config/regional/settings.  

Also, if you allow users to set their own timezone in user/1/edit, it would use that time.

So either you need to change the timezone in admin/config/regional/settings and/or in user/1/edit