
You could do it manually, or like I did around the turn of the century, by using a “Find and Replace” feature of some web authoring tool. An even better way is to present the date dynamically, and yes, even if you’re not using a server side technology like PHP or ASP.
Below are code snippets in various languages to present the current year on a web page. Note that I’m using the © character attribute for displaying the copyright symbol (and so should you).
Javascript
This code can be used on any web page, including static HTML pages.<script type="text/javascript">
var theDate=new Date()
document.write(theDate.getFullYear())
</script>
PHP
©<?php echo date(Y);?>
or
©<? echo date(Y);?>
ASP
©<%=year(date)%>
Coldfusion
<cfoutput>© #Year(Now())#</cfoutput>
Server
Side
Includes
(SSI)
<!--#config timefmt="%Y" -->
<!--#echo var="date_LOCAL" -->
0 comments:
Post a Comment