0

I use migrate to import an RSS feed as nodes in Drupal 8. All works well, except the timezone.

  created:
    plugin: format_date
    from_format: 'D, d M Y H:i:s O'
    to_format: U
    from_timezone: America/New_York
    to_timezone: UTC
    source: pub_date 

For example: Source time: Wed, 20 May 2020 15:20:15 -0400 Drupal node time: 20.05.20 21:20

I want the time to stay 20.05.20 15:20:15 but whatever i change in timezones (from_timezone and to_timezone) the result is just the same, it adds 6 hours. Server timezone is Europe/Berlin.

  • I understand that date field stored in UTC. But how can i import the correct time? In my case i want the time to stay the same, without the -0400. – Theodore Dimitriadis May 22 at 7:43
  • Did you change the timezone in Drupal /admin/config/regional/settings or in your user account settings? Those are the ones used for rendering – Hudri May 22 at 8:11
  • Yes, the timezone in Drupal is Europe/Berlin. Is there a way to ignore the -0400 in from_format and just use the date/time ? – Theodore Dimitriadis May 22 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.