Vcoderz Community
We create websites that have it all, beauty & brains
Lebanon Web Design & Development - Coddict
 

Go Back   Vcoderz Community > Computer Zone > Computers & Information Technologies > E-Learning Center

Notices

E-Learning Center E-Learning tutorials and competitions.

Reply
 
Share Thread Tools Search this Thread
Old 07-28-2008   #1
Google

 
Google's Avatar
 
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
Default Do You Know?! -1-

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>
Try to refresh the page, and see the increment of the number of milliseconds...



Google is offline   Reply With Quote
Old 07-28-2008   #2
chaingang_100
Registered Member
 
chaingang_100's Avatar
 
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
Default Re: Do You Know?! -1-

Quote:
Originally Posted by 454447415244 View Post
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>
Try to refresh the page, and see the increment of the number of milliseconds...

Why from January 1 1970???? and btw it's: 1216954622737ms

Last edited by chaingang_100; 07-29-2008 at 12:03 AM.
chaingang_100 is offline   Reply With Quote
Old 07-29-2008   #3
Google

 
Google's Avatar
 
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
Default Re: Do You Know?! -1-

Quote:
Originally Posted by chaingang_100 View Post
Why from January 1 1970???? and btw it's: 1216954622737ms
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>
This example will calculate the number of years since 1970/01/01 !
Google is offline   Reply With Quote
The Following 2 Users Say Thank You to Google For This Useful Post:
Justin (07-31-2008), Kingroudy (07-29-2008)
Old 08-03-2008   #4
chaingang_100
Registered Member
 
chaingang_100's Avatar
 
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
Default Re: Do You Know?! -1-

Quote:
Originally Posted by 454447415244 View Post
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
Well, i foun the answer, and here it is: "According to their Linux overview, Linux is following the tradition set by Unix of counting time in seconds since its official "birthday," -- called "epoch" in computing terms -- which is Jan. 1, 1970".

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.
chaingang_100 is offline   Reply With Quote
Old 08-04-2008   #5
Google

 
Google's Avatar
 
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
Default Re: Do You Know?! -1-

Quote:
Originally Posted by chaingang_100 View Post
Well, i foun the answer, and here it is: "According to their Linux overview, Linux is following the tradition set by Unix of counting time in seconds since its official "birthday," -- called "epoch" in computing terms -- which is Jan. 1, 1970".

So i think somehow it's related to the javascript getTime method


Source: Click Here

Thank You
Well, thank you very much for the info
Google is offline   Reply With Quote
Reply

  Vcoderz Community > Computer Zone > Computers & Information Technologies > E-Learning Center



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:49 PM.


Lebanon web design and development
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Share