473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

automatically insert current year

Hi,
Can anyone tell me a simple way of inserting some sort of code into a
Dreamweaver template (it goes at the bottom of the page in Copyright
info) that will cause the current year to be automatically inserted at
spot X when the pages are viewed that were produced from the template
or are linked to it?

Thanks
Dave
Jul 20 '05 #1
4 20642
LJL
ze********@yahoo.com.au (Dave) wrote in
news:6e**************************@posting.google.c om:
Hi,
Can anyone tell me a simple way of inserting some sort of code into a
Dreamweaver template (it goes at the bottom of the page in Copyright
info) that will cause the current year to be automatically inserted at
spot X when the pages are viewed that were produced from the template
or are linked to it?

Thanks
Dave


In the HTML portion of the page write:
Copyright &copy; <SCRIPT>
<!--
var year=new Date();
year=year.getYear();
if (year<1900) year+=1900;
document.write(year);
//-->
</SCRIPT> Your Name, All Rights Reserved.

This will get the date, grab the year from the date, check to make sure it
is in 4-digit format (just in case) and insert it after a copyright "C" in
a circle and before your name. If put in as it is here, it should look
like this:

Copyright © 2004 Your Name, All Rights Reserved

Good luck, LJL
Jul 20 '05 #2

"LJL" <no**@nowhere.com> wrote in message
news:Xn****************************@207.69.154.201 ...
In the HTML portion of the page write:
Copyright &copy; <SCRIPT>
<!--
var year=new Date();
year=year.getYear();
if (year<1900) year+=1900;
document.write(year);
//-->
</SCRIPT> Your Name, All Rights Reserved.


Why not just:

Copyright &copy; <script type="text/javascript">
document.write(new Date().getFullYear());
</script> Your Name, All Rights Reserved.

?
JW

Jul 20 '05 #3
Dave wrote:
Hi,
Can anyone tell me a simple way of inserting some sort of code into a
Dreamweaver template (it goes at the bottom of the page in Copyright
info) that will cause the current year to be automatically inserted at
spot X when the pages are viewed that were produced from the template
or are linked to it?

Thanks
Dave


Hi Dave,

Without any knowlegde of Dreamweaver whatsoever, try this:

current year:
<script type="text/javascript">
D = new Date();
year = D.getFullYear();
document.write(year);
</script>

It produces the year as set on the clientmachine.

Regards,
Erwin Moller
Jul 20 '05 #4
Thank you to you all for the kind suggestions - they all work!

Dave

Erwin Moller <si******************************************@spam yourself.com> wrote in message news:<40*********************@news.xs4all.nl>...
Dave wrote:
Hi,
Can anyone tell me a simple way of inserting some sort of code into a
Dreamweaver template (it goes at the bottom of the page in Copyright
info) that will cause the current year to be automatically inserted at
spot X when the pages are viewed that were produced from the template
or are linked to it?

Thanks
Dave


Hi Dave,

Without any knowlegde of Dreamweaver whatsoever, try this:

current year:
<script type="text/javascript">
D = new Date();
year = D.getFullYear();
document.write(year);
</script>

It produces the year as set on the clientmachine.

Regards,
Erwin Moller

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Karen Middleton | last post by:
In MS Access I can do in one SQL statement a update if exists else a insert. Assuming my source staging table is called - SOURCE and my target table is called - DEST and both of them have the...
9
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM,...
31
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
6
by: Hasanain F. Esmail | last post by:
Hi all, I sincerly thank you all in advance for your help to solve this problem. I have been trying to find a solution to this problem for sometime now but have failed. I am working on a...
3
by: Stephen V | last post by:
Can anyone help me out with this problem. I would like to redirect/ go to another php page when my SQL insertion is done and also send a variable at the same time. the idea is, to come on my...
1
by: deejayquai | last post by:
Hello I'm trying to append a series of values into fields from one table to another based on highlighted rows in a multi-select listbox. I'm stuck however when I need to append a couple of...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
0
BenRatcliffe
by: BenRatcliffe | last post by:
Hi there, I was wondering if anyone could help me. I have a comlpex database with a number of forms that have data entered on them and then saved into the correct table etc. In this instance I am...
2
by: clloyd | last post by:
I have a form that when you hit a command button it moves the current year value (could be three years prior) to a previous year field. I need code to insert the current year in the current year...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.