Thursday 16 May 2013

Always Display the Current Year in your © Copyright Notice


situation

Keep my Copyright label updated.
problem

Always Display the Current Year in your © Copyright Notice in HTML, PHP, ASP and Joomla
difficulty level

1/10 :))
compatibility

For HTML, PHP, ASP and Joomla
solution

HTML
<p>&copy; Copyright 2000-
<script language="JavaScript" type="text/javascript">
    now = new Date
    theYear=now.getYear()
    if (theYear < 1900)
    theYear=theYear+1900
    document.write(theYear)
</script>

My Company, Inc. All rights reserved. Version 4.01g</p>

PHP
date("Y")

Joomla
    <div id="footer">
        <span class="copy"><?php echo JText::_('My company &copy; 2009
-'.date("Y").' |');?> <a href="index.php?option=com_content&amp;view=article&amp;catid=84&amp;id=130&amp;Itemid=464">Privacy Policy</a></span>
    </div>

ASP
<h6>&copy;
@DateTime.Now.Year - My Company</h6>