Displaying the current date

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

Be the first to comment this article!


Add a comment


(will not be displayed, Gravatar is enabled)



(Fields marked with a * are mandatory)

Visitors found this page by searching for these keywords:

typoscript date · typoscript strftime · hamburg luftfahrtbedarf · typoscipt current date · typoscript get date