I'm using core JSON api to POST/PATCH data from an Android App to my Drupal 8 site. When I need to fill a datetime field I use the next JSON, for example, 2020-02-20T13:15:00. But with this format, this time is UTC, but I need Europe/Madrid timezone. How should I do it?
DateTimeNormalizer, the inferface format is RFC3339, which is
Y-m-d\TH:i:sP as an input format string. It also accepts the ISO8601 PHP string, which is
Try using strings like in your request '2020-02-20T13:15:00+01:00'.
What I suspect is happening, is that since you aren't specifying the UTC offset, it is being interpreted as '+00:00'
The denormalizer also allepts a format string with the request to parse the
value. I believe it is called
EntityTestDatetimeTest for some more examples.