Skip to content

dart-creations.com

Advertisement
Home
Print E-mail
Tuesday, 24 March 2009
The current tip comes from the great man himself, Andrew Eddie from the Art of Joomla. 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:

<div id="copyright">        Copyright ©  - <?php echo date('Y');?> Your Company    </div> 
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 @ http://php.net/date. There are many variations which you can use for the displaying information related to dates.
Comments
Search RSS
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Tuesday, 24 March 2009 )
 

Sponsors

Login Form






Lost Password?
No account yet? Register

Generated in 0.30535 Seconds