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.
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.