getSeconds to collect Seconds

We can collect second from the date and time like this. Here is an example
var dt= new Date();
document.write(dt.getSeconds());
Here is the second part of your ( client ) computer date and time

We can also take Seconds part from any date variable.
var dt= new Date("Aug 15, 2013 13:52:45");
document.write(dt.getSeconds());
Output is here

Showing changing Seconds value

Here we are displaying the seconds value when the page loads. This value does not change on real time. So we will execute the code in every seconds to display the real changing seconds value. To execute the code repeatedly we will use setTimeout function which triggers in every 1000 mille seconds ( 1 second )
Your Rating





More on JavaScript Date & Time

Post your comments , suggestion , error , requirements etc here .




HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer