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?

1 Answer 1

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)
4
  • 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
    Commented Aug 3, 2018 at 15:59
  • It it possible to choose the output language? I would like to show the date in French fr_FR format.
    – ZKB
    Commented Jul 27, 2021 at 16:12
  • Found it: [%format_date(now(), 'dd MMMM yyyy', 'fr_FR')%]
    – ZKB
    Commented Jul 27, 2021 at 16:27
  • $CURRENT_DATE(yyyy-MM-dd) still works, and without an expression. twitter.com/qgis/status/144365563752349696
    – HeikkiVesanto
    Commented Oct 17, 2022 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.