10-08-2018 15:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-08-2018 15:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm looking to create a countdown in days to something important like a meeting or birthday. Is there a simple way to do this?
I've tried using the command below, but I'm unable to make this work.
.getTime();
Answered! Go to the Best Answer.

Accepted Solutions
10-09-2018 08:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-09-2018 08:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
A simple JavaScript example could be easily adapted.
https://www.w3schools.com/howto/howto_js_countdown.asp

10-09-2018 08:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-09-2018 08:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
A simple JavaScript example could be easily adapted.
https://www.w3schools.com/howto/howto_js_countdown.asp

11-30-2018 05:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-30-2018 05:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm trying the same thing but I can't seem to make the javascript work. Is there something simple I'm missing? Thanks for any help. Code I'm trying below:
import document from "document"; // Set the date we're counting down to var countDownDate = new Date("Jan 5, 2019 15:37:25").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now and the count down date var distance = countDownDate - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Output the result in an element with id="demo" document.getElementById("demo").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("demo").innerHTML = "EXPIRED"; } let demo = document.getElementById("demo"); }, 1000);

11-30-2018 06:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-30-2018 06:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Do you need:
import clock from "clock";
to get the Date functionality?

11-30-2018 07:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-30-2018 07:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks.
Added that doesn't seem to make a difference though. Just returns a blank screen.

11-30-2018 14:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-30-2018 14:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Have you tried using a <text> element to display the countdown? innerHTML is for html documents but watchfaces are svg.

12-29-2019 15:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-29-2019 15:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello, I have a Fitbit versa 2. How can I make this work? Or is there an app for this that I am not aware of?
Thanks

07-11-2023 09:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-11-2023 09:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Did you ever get the days countdown timer to work? I'm looking for that type of watch face for fitbit versa 4 and at 70 yo I don't want to learn coding? 😉

09-27-2023 01:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-27-2023 01:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Mtn-Mike, I haven’t developed a watch face since 2020, but I’m considering making a countdown for my next one. I’ll let you know and post here if I get it working.
the problem is being able to allow the user to set a date in their phone that would update the watch face timer and keep that date in the watch until it’s changed.
I was able to get a date and countdown going in 2020, but linking it to the app and saving that date to the watch so the code can do the calculations was not working.
I’ll update this if I figure that out.
