Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying a digital clock #74

Closed
grafikkaos opened this issue Aug 30, 2016 · 1 comment
Closed

Displaying a digital clock #74

grafikkaos opened this issue Aug 30, 2016 · 1 comment

Comments

@grafikkaos
Copy link

Is there a quick way of using this plugin to display a clock showing the current time?

Thanks

@walmik
Copy link
Owner

walmik commented Aug 31, 2016

@grafikkaos
Hi Emmanuel! The jQuery timer plugin does not have a readymade feature to display a digital clock, though you can get hold of the current time in seconds and initialize the timer from that time, like this:

var d = new Date();
var todayInSeconds = d.getSeconds() + (60 * d.getMinutes()) + (60 * 60 * d.getHours());

$('#timerDiv').timer({
    seconds: todayInSeconds
});

Lemme know if that works for you.

@walmik walmik closed this as completed Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants