Finding the number of seconds and milliseconds
Sponsored Links
Format #9: Finding the number of seconds and milliseconds
getSeconds() and getMIlliseconds() return the seconds and milliseconds values.
<script type="text/javascript"> <!-- var d = new Date(); var curr_hour = d.getHours(); var curr_min = d.getMinutes(); var curr_sec = d.getSeconds(); var curr_msec = d.getMilliseconds(); document.write(curr_hour + ":" + curr_min + ":" + curr_sec + ":" + curr_msec); //--> </script>
Format #10: GMT Time
Each of the methods discussed so far calculates time on the client-side (browser). JavaScript also supplies us, similar methods for finding the GMT (called the Universal Coordinated Time or UTC).
- getUTCDate(): Date
- getUTCMonth(): Month
- getUTCFullYear(): Year (4 digit)
- getUTCDay(): Day
- getUTCHours(): Hours
- getUTCMinutes(): Minutes
- getUTCSeconds(): Seconds
- getUTCMilliseconds(): Milliseconds
You can use these methods to find the GMT and format it based on scripts discussed before.
Click this button if you liked the article!
Page contents: Time formats in JavaScript. How to find the number of seconds and milliseconds using simple JavaScript code.
Comments, questions, feedback... whatever!
Recent Articles
Recent Blog Posts
Popular Articles
- Hotmail Sign In page
- Create a Hotmail account - Instructions
- Create Gmail address
- Download and install Outlook Express
- Get your free Gmail address
- Outlook Express new version
- Create my own email address
- Browers for Windows list
- Get email address
- Color combinations for web sites and pages
- Create Yahoo ID
More web tips & tricks
- Outlook Express Help - tips & tricks (53)
- Windows Live Mail help and tips (36)
- Windows Mail help (25)
- Hotmail help and tips (42)
- Yahoo help & support (45)
- AOL email help (26)
- Gmail help and tips (36)
- Internet tips & tricks (12)
- Web Design tips & tricks (33)
- HTML, Javascript tips tricks (68)
- Web Promotion tips & tricks (8)
- Graphics tips & tricks (20)
