Project: QGIS

Version: 3.12

Feature: Language support for format_date() and to_{date,datetime,time}()

  • format_date('2012-05-15','d MMMM yyyy','fr') → '15 mai 2012'
  • format_date('2012-05-15','d MMMM yyyy','it') → '15 maggio 2012'
  • format_date('2012-05-15','d MMMM yyyy','en') → '15 May 2012' Formats a date type or string into a custom string format. Uses Qt date/time format strings. See QDateTime::toString.

By default, those expression use the application's locale. The addition of an optional language parameter allows handling of dates that wouldn't match that default locale (say for e.g. an English system running QGIS trying to transform a French-formatted string into a date object).

This feature was developed by Mathieu Pellerin