Get The Current Year With PHP

Date: 10/09/2015, Author: Lostwake, Category: PHP Quick Reference

I use the date function on php to get the date and time for my application.

Below is an example of displaying just the year.

echo date("Y");

And this is one displaying everything. You can play with the variables to get what you want.

echo date("Y-m-d H:i:s",time());

Leave a comment if you have questions or see an error.