GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing javascript.info — How many seconds have passed today? back to the lesson How many seconds have passed today?importance: 5 Write a function For instance, if now were
The function should work in any day. That is, it should not have a hard-coded value of “today”. To get the number of seconds, we can generate a date using the current day and time 00:00:00, then substract it from “now”. The difference is the number of milliseconds from the beginning of the day, that we should divide by 1000 to get seconds: An alternative solution would be to get hours/minutes/seconds and convert them to seconds: |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |