TYPO3

Displaying the current date

deutsch Hier klicken, um diese Seite auf Deutsch zu lesen: Aktuelles Datum anzeigen

You can display the current date in various formats on a web site. This can be implemented by using the PHP function strftime within your TypoScript template record.

TypoScript: Current date

SETUP
temp.current_date = TEXT
temp.current_date {
  data = date : U
  strftime = %A, %e. %B %Y
}

The strftime format string %A, %B %e, %Y in the example above will output the date in the format Tuesday, June 27, 2006.

In a multilingual web site with the config.locale_all option set appropriately, the names of the weekdays and months will be shown in the respective language of the site.

Date and time formats of the strftime function

According to ISO standards, there are many more options for the strftime function than those used in the example (weekday, day, month, and year). All these can also be used within TypoScript templates.

To get an overview of all possible options, please see the documentation of the strftime function on the official PHP web site.

Comments for Displaying the current date

Add a comment


(will not be displayed)


(Fields marked with a * are mandatory)
Please note that your comment will be checked before it gets published.
Latest TYPO3 tutorial
How to define special links with custom tags

How to define special links with custom tags

September 2010 – How you can define your own tags for specific links in TYPO3. We show tags for nofollow links, links to other languages and links to tt_news records. more »

Latest TypoScript snippet
Automated backlink to parent page

Automated backlink to parent page

December 2009 – How to automatically generate a back link to a page one level above the current page. more »

Latest glossary entry
File browsers in TYPO3

File browsers in TYPO3

March 2010 – What are file browsers in TYPO3 and how can they be used? more »