Countdown Timer - 14 days from specific date & time

Hi guys,

I’m trying to use the countdown timer to countdown 14 days from a specific date & time field in my collection. Essentially, a user can buy a discount card that is valid for 14 days and I want to display this to them.

I was hoping to be able to use the date & time field + 1209600 seconds (14 days). This doesn’t seem to work though and it currently starts counting down from 14 says, 5 hours, 13 minutes and 47 seconds. I’m not sure if I’m completely missing the obvious and my calculation is just wrong (it’s been a long day!). Can anyone help?

image

Thanks,
Ash

Hi Ash,

I would create both fields at the same time: purchase date, expiration date (2 weeks after current date/time).

It should be easy to show it once you’ve done that and it’ll be easier to show on the voucher pages etc without using logic.

Thanks for the reply @Erik

I’ve created a expiration date as you’ve suggested but I still can’t get the timer to display correctly. What should the formula be in the countdown timer to countdown to the expiry time?

You’ll want to double check this, but from a quick test, I did:

(expirationDate - purchaseDate)*86400

seems to work.

Thanks @Erik

That didn’t quite work but I found a tutorial by Victor which walked me through it. Essentially I needed another property in the order collection which works out of the amount of seconds between the start and end dates. That value is then used for the countdown timer.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.