Search:
Type: Posts; User: Juuitchan
Search:
Search took 0.04 seconds.
-
Simple. Just grab today's date and stick it in.
var curdate=new Date(); // gets today's date
var cdnum=dayofyear(curdate);
document.write('Today is day number '+cdnum+' of the current...
-
Rianna,
JavaScript allows you to create your own functions. I strongly suggest you read up on this.
The first piece of code I gave you was a function I wrote. It contains code which tells your...
-
The usage of my function is as follows:
var a=new Date("July 1, 2007");
var b=dayofyear(a);
alert(b);
If my math is correct, and if the function is correct, this will give you the...
-
I believe that no such function exists.
And Gil forgot about daylight saving time. His code contains a subtle bug that Rianna might well have not noticed.
Let me see what I can do:
...
-
If you want more info, go to: www.php.net
-
Use PHP instead of JavaScript.
This will give you the current month:
<?php echo date("F") ?>
This will (unless I'm mistaken) give you what you seem to want:
<?php echo "<a...
-
What's the point of that?! You are effectively using the user's watch to tell him the time!
-
-
-
Why aren't you using server-side for this?!
Don't you know that you should use JavaScript pretty much only when forced to?
-
Interpreters are heartless. They don't care that it's "just a typo".
-
The function gmdate() is just like date(), except that it always gives you Greenwich Mean Time.
The way I see it is, to solve your problem I would do this:
- Get the current time using time().
-...
-
That'll give you a string, Chuck.
-
NogDog's code:
$age = ($nowMo > $dobMo or ($nowMo = $dobMo and $nowDay >= $dobDay)) ?
$nowYr - $dobYr : $nowYr - $dobYr - 1;
Please examine this part:
-
Amir, throw that book away.
Now do as I say, Amir. Right after your line
thisYear = today.getYear()
put this:
document.write("<br>The variable thisYear now equals: "+thisYear+"<br>");
-
Amir:
1) Why are you using leading zeros? Leading zeros means octal.
2) What does getYear do?
3) No server-side anything is LAME.
-
mm=mm<10?'0'+(mm+1):mm+1;
Oy vey.
-
The former, as I prefer depth to breadth.
Physical abuse or psychological abuse?
-
Please refresh the file in your browser, cardona, and then try again.
If it refuses to refresh, try using a browser other than Internet Explorer.
Also, cardona, consider modifying the code to...
-
// Change this
var mm=nextDay.getMonth();
// to this
var mm=nextDay.getMonth()+1;
// and see if that works.
-
Leave txtDate1 out of the names array, then.
-
The "value" of a textbox is a string, not a number.
How about changing this
document.getElementById('counter').value++;
to this?
-
You forgot about the weird month numbering.
When using new Date(year, month, day), the month uses funny numbering: January = 0, February = 1, etc. So you will have to allow for this.
-
I doubt it, Chuck.
We should do a survey to see who's right, though. Hey, Kor!
-
It is a huge problem, Rterres.
Why did you not tell us exactly what it was you were trying to do?
You said that you wanted a conversion, but you did not say what you were converting from.
My...
|
|