# Dynamic Countdown Timer For wedding day 

**URL:** <https://forum.wixstudio.com/t/dynamic-countdown-timer-for-wedding-day/24563>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [December 3, 2020, 2:34am UTC](https://forum.wixstudio.com/t/dynamic-countdown-timer-for-wedding-day/24563 "2020-12-03T02:34:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucas44751](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/lucas44751/32/8641_2.png) [@lucas44751](https://forum.wixstudio.com/u/lucas44751)\
**Post date:** [December 3, 2020, 2:34am UTC](https://forum.wixstudio.com/t/dynamic-countdown-timer-for-wedding-day/24563/1 "2020-12-03T02:34:23Z")

</div>

I have been trying to implement this code on a page on my site for my wedding cupels so they can see how many days they would have left until there wedding day but have had no luck with the timer connecting with my datasets

I did not write this code myself,

```javascript
import wixWindow from 'wix-window';
import wixData from 'wix-data';

$w.onReady( () => {
  $w("#dynamicDataset").onReady( () => {
 let itemIndex = $w("#dynamicDataset").getCurrentItem();
  } );
} );

let eventDate = new Date("Dec 29,2020 14:00:00").getTime();// Countdown date and time

 
 
 let eventDate = setInterval(function () {
 let now = new Date().getTime();
 let timeLeft = eventDate - now;

 let days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
 let hours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
 let minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
 let seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
 
                $w("#days").text = "" + days;
                $w("#hours").text = "" + hours;
                $w("#minutes").text = "" + minutes;
                $w("#seconds").text = "" + seconds;
                       }
            , 1000);
 

 

```

I Belive this is the part of the code that I need to connect with my data set

```javascript
let eventDate = new Date("Dec 29,2020 14:00:00").getTime();// Countdown date and time

```

any help would be muchly appreciated

Thanks  
Lucas
