There are many instances where you might want to display the current year on your website. This may include copyright notices, founding dates, user sign up dates and more.
In this tutorial we will cover how to display the current year using the date function in php. The date function can be used to get the current date and this can be used in combination with php's echo function as shown below:
echo date("Y");
This will output the current year. At the time of writing this article, that's 2023.
Comments