I'm using format_date process plugin to import data from external API to drupal 8 node.
The date/time in API is "Asia/Jerusalem" time - 2017-06-24 20:52:55
The date/time from the API is saved in drupal node as it was a UTC 2017-06-24T20:52:55
When the node is displayed (I have "Asia/Jerusalem" timezone defined for me) it shows 2017-06-24 23:52:55
This is the configuration file I used
source:
fields:
-
name: status_updated
label: 'Status updated'
selector: status_updated
destination:
plugin: 'entity:node'
process:
field_ext_status_updated:
plugin: format_date
from_format: 'Y-m-d H:i:s'
to_format: 'Y-m-d\TH:i:s'
#timezone: 'Asia/Jerusalem'
settings:
validate_format: false
source: status_updated
I need either to convert the source date first from "Asia/Jerusalem" to "UTC" and then pass it to format_date or change the configuration file in way that it will save the date as 2017-06-24T17:52:55
so for users with timezone "Asia/Jerusalem" it will show the correct date/time 2017-06-24 20:52:55
How can I achieve it?
removing the comment for timezone: 'Asia/Jerusalem'
not helped