6. Convert String to Date Attributes

There's one more issue that we need to solve in the attribute table. The Year field is text and it should be a date, otherwise we can't use it later in the Temporal Controller.

4. Go back to the Field Calculator.

5. Create a new field with the name Date and Output field type Date. Use the following expression:

to_date(  "Year" , 'yyyy')


With the to_date function you can convert a string to a date. We indicate with 'yyyy' that it's year with for digits.

6. Click OK and check the result.

Note that the dates are all set to 1 January of the year. For us it's only relevant that it now recognizes the years as dates.


7. Toggle off editing and save the result.

Now we're ready to join the data with the country boundary polygons.