Update Copyright in Javascript and Coldfusion
Although you only have to do it once a year, keeping the copyright updated on your web site(s) can sometimes be troublesome... The best thing to do would be to automate the process.. Here are two ways you can accomplish this. 1. Javascript:
<script language="JavaScript">
var d=new Date();
yr=d.getFullYear();
if (yr!=2003)
document.write("- "+yr);
</script>
<CFSET createdYear = DateFormat('1/1/2001', 'yyyy')>
<CFSET currentYear = DateFormat(now(), 'yyyy')>
<CFOUTPUT>
© #createdYear#
<!--- if the createdYear and currentYear are different then show both years --->
<CFIF createdYear neq currentYear>
- #currentYear#
</CFIF>
</CFOUTPUT>
Your site Name.



There are no comments for this entry.
[Add Comment]