21

Is there a way in the Print Composer of QGIS to create a label that will automatically update the date (systems date) instead of having a label that you have to manually have to update?

underdark
  • 84,148
  • 21
  • 231
  • 413
geosmiles
  • 1,367
  • 3
  • 16
  • 33

1 Answers1

39

Yes, you can add

format_date( now(),'yyyy-MM-dd HH:mm:ss')

This used to be the old syntax:

$CURRENT_DATE(yyyy-MM-dd)
underdark
  • 84,148
  • 21
  • 231
  • 413
  • 8
    In QGIS3, if adding as a label in your Layout, you could add this code to the Label item's 'Main properties' text box [% format_date( now(),'MM/dd/yyyy') %] – cm1 Aug 03 '18 at 15:59
  • It it possible to choose the output language? I would like to show the date in French fr_FR format. – ZKB Jul 27 '21 at 16:12
  • Found it: [%format_date(now(), 'dd MMMM yyyy', 'fr_FR')%] – ZKB Jul 27 '21 at 16:27
  • $CURRENT_DATE(yyyy-MM-dd) still works, and without an expression. https://twitter.com/qgis/status/144365563752349696 – HeikkiVesanto Oct 17 '22 at 11:35