ComboStrap - Date Component


The date component was deprecated for the date variable.

This article has been saved for historical purpose.

Why ?

  • The function strftime was deprecated and will be no more available from php version 8
  • The date format is not the standard.
  • The pipeline format function can be enhanced to format also number.


With the date component, you could format any date:


Today's date

  • The markup
  • The output is a date formatted to the default format.

Tuesday, 18 June 2024

To have it refresh every day, we expire the cache date daily

<cache expiration="@daily"/>

Today's date - short format

  • Today's date with a short month description and the day number US style
<date format="%h %d"/>
  • The output:

Jun 18

Today's date in French

  • The markup with the locale attribute with just the region (ie country) as value.
<date locale="fr"/>
  • The output is a date formatted with French word.

Tuesday, 18 June 2024

Date specified manually

<date format="%A">2021-09-27</date>
  • The output gives the day name of the date (ie %A)


Date of a page

You can even print a date metadata of a page.

  • The output will be:

Monday, 17 April 2023


  • For the today's date
<date format="formatValue" lang="language"/>
  • When specifying a date value
<date format="formatValue" lang="language">dateValue</date>


Task Runner