JavaScript Error
I got a script:
<script language="JavaScript">
1) ? nd.getYear().substr(2,2) : nd.getYear();
var mins = nd.getMinutes();
var hours = (nd.getHours() > 12) ? nd.getHours() - 12 : nd.getHours();
var pmam = (nd.getHours() > 12) ? "pm" : "am";
var newdate = month + "/" + day + "/" + year + " " + hours + ":" + mins + pmam;
document.Registration.Date.value = newdate;
}
//-->
</script>
it does not seem to want to print the correct date. It prints out November instead of December
What is wrong with it?
Jack Michaelson posted this at 15:23 — 9th December 2002.
He has: 1,733 posts
Joined: Dec 1999
Is your system date ok?
nitestarz posted this at 15:24 — 9th December 2002.
They have: 38 posts
Joined: Dec 2002
yes it is!
Suzanne posted this at 17:48 — 9th December 2002.
She has: 5,507 posts
Joined: Feb 2000
You do know that JavaScript starts with 0, right? So 11 IS December.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.