<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>this line makes the trouble:</FONT></DIV>
<DIV><FONT face=Arial size=2> cDate = new Date(myDate.getTime() +
days*24*60*60*1000);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>try this: </FONT></DIV>
<DIV><FONT face=Arial size=2>function addDays(myDate,days)
{<BR>
days=days*24*60*60*1000<BR> cDate = new
Date(myDate.getTime() + days);<BR> dy =
cDate.getDate();<BR> mn =
cDate.getMonth();<BR> y =
cDate.getYear();<BR> h =
cDate.getHours();<BR> m =
cDate.getMinutes();<BR> s =
cDate.getSeconds();<BR> nDate = mn + "/" + dy + "/" + y
+ " " + h + ":" + m + ":" + s;<BR> return
nDate;<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>must be a js-bug, i canīt see why it didnīt work
with your code</FONT></DIV>
<DIV><FONT face=Arial size=2>Be aware that January is month
0 ! </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=dstoltz@shh.org href="mailto:dstoltz@shh.org">Dave Stoltz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu
href="mailto:javascript@LaTech.edu">'[JavaScript List]'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, January 02, 2004 4:12
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Javascript] ARGH! Help with
Dates!</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial size=2>I am trying
desperately to get the date in Javascript in EXACTLY this format: 1/4/2004
5:45 PM </FONT></SPAN></DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial size=2>This seems
painfully difficult....I have the following 2 functions working, except the
month comes back as 0 all the time.</FONT></SPAN></DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial size=2>If the dropdown
box called "Priority" is "Normal", I want to add 2 days to the current
date/time, and if Priority is "Emergency" I want to add 1 day to the current
date/time.</FONT></SPAN></DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial size=2>Here are my
functions, why is the month coming back as 0 !!!!???</FONT></SPAN></DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial size=2>Thanks for any
help!</FONT></SPAN></DIV>
<DIV><SPAN class=592390519-02012004></SPAN><SPAN
class=592390519-02012004><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=592390519-02012004><FONT face=Arial size=2><script
language="javascript"><BR><!--<BR>function addDays(myDate,days)
{<BR> cDate = new Date(myDate.getTime() +
days*24*60*60*1000);<BR> dy =
cDate.getDate();<BR> mn =
cDate.getMonth();<BR> y =
cDate.getYear();<BR> h =
cDate.getHours();<BR> m =
cDate.getMinutes();<BR> s =
cDate.getSeconds();<BR> nDate = mn + "/" + dy + "/" +
y + " " + h + ":" + m + ":" + s;<BR> return
nDate;<BR>}<BR>function setdueby(){<BR> var1 =
form1.Priority.value;<BR>
if(var1=='Normal'){<BR> var2 = (addDays(new
Date(),2));<BR>
form1.dueby.value=var2;<BR>
}<BR>
if(var1=='Emergency'){<BR> var3 = (addDays(new
Date(),1));<BR>
form1.dueby.value=var3;<BR> }}<BR>--><BR></script></FONT></SPAN></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Javascript mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE></BODY></HTML>