programming a date

P

Peggy Cosby

Hi,
I have MS Frontpage 2000, using win98. I am trying to get
a date on my web page(for exmple, September 21, 2003) to
automatically update and change to (the next Sunday, for
example September 28, 2003. I have looked in the offline
help, and online help databases, only to find nothing. I
am sure it is possible. But do not know how to do it!!!
Can you help me at all? Or is it even possible to do?

Thanks so much,
Peggy Cosby
(e-mail address removed)
 
M

MD WebsUnlimited.com

Hi Peggy,

If I understand the question you wish to have 'n' days added to the current
date each time the date is displayed? Is that correct? If so, do you wish to
accomplish this at the server or client? If at the server is your server
Windows based or Unix based? If at the client the code would be:

var oDate = new Date();
var oNewDate = newDate(oDate.getYear(), oDate.getMonth, oDate.getDate() +
iDays,oDate.getHours(),oDate.getMinutes(),oDate.getSeconds());

oNewDate contains the new date + iDays

I leave the formatting to you.
 
P

Peggy Cosby

Hi Mike,
First of all, I don't know what you are speaking of when
you use the words "Client" or "Server",unfortunately I am
not that educated in this stuff, so please bear with me.
This is the whole cituation...
On our churches web site there is a date displayed.
Example: September 21, 2003. I would like to somehow
program the web page to automatically update/change the
date to the following Sunday..Example: September 28, 2003.
In that format. It's that simple. Now, I don't think that
doing it will be as simple...LOL at least not for me since
I am so new at this.
If you could please let me know what you mean by "Client"
or "Server" perhaps I would have a better understanding of
what you are talking about when using those words. :(
(Sorry).
Second...
I have no clue as to where to place that HTML code that you
gave me..got any any hints? I realize I'm asking alot from
you, please forgive me and my ignorance. I can do some
HTML coding but I'm very limited. So if you could be very
specific I would greatly appreciate it :) :)

Thanks again,
Peggy Cosby
(e-mail address removed)
 
P

Peggy Cosby

Hey Mike,
I went to fpage and went to the glossary and looked these
up..is this what you are referring to???

client
On a local area network or the Internet, a computer that
accesses shared network resources provided by another
computer. See also server.

server
A computer that offers services on a network. On the World
Wide Web, a server is a computer that runs the Web server
software that responds to HTTP protocol requests. Also
called host.

In this case I would have to say Server is my answer,
whether it's windows based or unix based i have no
clue..lol sorry. Could you tell me how to figure that
answer out?
Thanks,
Peggy
 
P

Peggy Cosby

Mike,
ok I went again and looked up unix..

UNIX
A multi-user, multitasking operating system that exists in
various forms and implementations, typically used on
proprietary computer workstations. Many Web servers run on
UNIX systems.

All I can say to your question Mike, is that this computer
is a home computer, not a networking computer. It's used
only by me. My OP system is a multi taksing system lol
I swear I'm sooo stupid! lol As you can see I'm trying to
answer your question..I hope this helps.
Thanks Peggy
 
L

Lisa Wollin \(Microsoft\)

Don't worry about it, Peggy. We all had to start somewhere.

In your case, your client machine (the machine on which you view your web
site in a browser) is the same as your server machine (the machine that
hosts your web site).

The script that Mike provided is a bit incomplete. (It didn't include a
value for iDays.) I've updated the script a bit. You can add this to the
<HEAD> section of your page.

<script language="javascript">

function GetSundayDate(){
var oDate = new Date();
var oNewDate;
var sDate = "Sunday, ";

if (oDate.getDay == 0)
{
oNewDate = newDate(oDate.getYear(), oDate.getMonth, oDate.getDate());
}
else
{
var iDays = 7 - oDate.getDay();
oNewDate = new Date(oDate.getYear(), oDate.getMonth(), oDate.getDate() +
iDays, oDate.getHours(),oDate.getMinutes(),oDate.getSeconds());
}

sDate += oNewDate.getMonth() + "/" + oNewDate.getDate() + "/" +
oNewDate.getYear();
return sDate;
}
</script>

Then, where you want the date to display on the page, put the following
code:

<script language="javascript">document.write(GetSundayDate());</script>

Hope this helps.

--
Lisa Wollin
Programmer Writer
Microsoft Corporation

Mike,
ok I went again and looked up unix..

UNIX
A multi-user, multitasking operating system that exists in
various forms and implementations, typically used on
proprietary computer workstations. Many Web servers run on
UNIX systems.

All I can say to your question Mike, is that this computer
is a home computer, not a networking computer. It's used
only by me. My OP system is a multi taksing system lol
I swear I'm sooo stupid! lol As you can see I'm trying to
answer your question..I hope this helps.
Thanks Peggy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top