Display the Year in your Joomla template

Sometimes you need to display the current date or ideally the current year, typically in copyright notices or anywhere else required by your template. The following simple php function will allow you to easily achieve this. Find the area where you want to display the year, this is probably somewhere in the index.php of your template, or possibly in the footer.php. Then addd the following code:

This takes the current date and displays only the year. Obviously, if you don't need the copyright notice you will need to change the text to what you require, but this is basically what you will need. There are more options which you can use with the PHP date function, you can find more information on what you can do with the date function @ https://www.php.net/manual/en/function.date.php There are many variations which you can use for the displaying information related to dates.

© 2024, Joomla King

Contact Info