How to convert year to date with Migrate I try to import a CSV file with Drupal 8 Migrate. One column contains a year value which I want to convert to a Drupal date field.

I try to do that with the following process statement using format_date plugin from Migrate Plus but something goes wrong:

  process:
    field_fecha:
      plugin: format_date
      from_format: 'Y'
      to_format: 'Y-m-d\TH:i:s'
      settings:
        validate_format: false
      source: year


I'm not sure if Y is allowed as from_format value. But I also don't know what standard value uses Drupal 8 date field and what to put as to_format value.
Just found out that to_format value is the problem. Setting it to 'Y-m-d' works fine and imports the year value as date putting month and day to values of today. So actually to get specific day and month added to year value, this code works fine:

process:
    field_fecha:
      plugin: format_date
      from_format: 'Y'
      to_format: 'Y-01-01'
      source: year


Probably that's because I defined the date field as "date only". For "date and time" fields 'Y-m-d\TH:i:s' should work fine.