|
|
|||||||
| E-Learning Center « E-Learning tutorials and competitions. » |
![]() |
|
|
Share | Thread Tools | Search this Thread |
|
|
#1 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
Do you know that the JavaScript getTime() method returns the number of milliseconds since midnight of January 1, 1970 ?!
If you are not sure, copy this code and paste it in notepad and save the file as .html This is the code: Code:
<script> date = new Date(); time = date.getTime(); document.write(time); </script> |
|
|
|
|
|
#2 | |
|
Registered Member
Last Online: 10-23-2012
Join Date: May 2007
Posts: 733
Thanks: 521
Thanked 394 Times in 240 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
|
Quote:
Last edited by chaingang_100; 07-29-2008 at 12:03 AM. |
|
|
|
|
|
|
#3 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
I really don't know why god created it to start counting from that date
![]() If you can tell us, we would be very thankful And take this second example: Code:
<script>
var minutes = 1000*60;
var hours = minutes*60;
var days = hours*24;
var years = days*365;
var d = new Date();
var t = d.getTime();
var y = t/years;
document.write("It's been: " + y + " years since 1970/01/01!");
</script>
|
|
|
|
|
|
#4 | |
|
Registered Member
Last Online: 10-23-2012
Join Date: May 2007
Posts: 733
Thanks: 521
Thanked 394 Times in 240 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
|
Quote:
So i think somehow it's related to the javascript getTime method Source: Click Here Thank You Last edited by chaingang_100; 08-03-2008 at 01:32 AM. |
|
|
|
|
|
|
#5 | |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
Quote:
|
|
|
|
|
![]() |
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|