Countdown between 2 dates

Hello, I’m going to my daughter’s wedding in about ten days, can you help me write a countdown from the current time to the ceremony time? I think I’m a little old to do math…
In hours, even seconds. Thank you for your help, if you accept the challenge.

Here it is:

DAYS:

(floor((((1659154830-([UTC_TS]/1000))/60)/60)/24))

HOURS

(floor((((((1659154830-([UTC_TS]/1000))/60)/60)/24)%1)*24))

MINUTES

(floor((((((((1659154830-([UTC_TS]/1000))/60)/60)/24)%1)*24)%1)*60))

SECONDS

(floor((((((((((1659154830-([UTC_TS]/1000))/60)/60)/24)%1)*24)%1)*60)%1)*60))

Replace 1659154830 with your event UTC Timestamp in seconds. Maybe it can be written better, but I don’t have much time to think about it :smiley:

I wish your daughter all the best in life and enjoy the wedding!

Tomas

Edit: Simple way

  1. Install Google Clock app
  2. create or use watch face with a custom complication (preferably RANGED_VALUE or SHORT_TEXT)
  3. customize & add “Countdown to date” complication
  4. set event date when prompted and profit !
3 Likes

A big thank you for your collaboration and thank you, also for your wishes for the wedding. My daughter (French, but also English for 3 years) is marrying an Englishman from Newcastle, in Newcastle. I will have to improve my English.
Again a big thank you!

1 Like

Thanks a lot Tomas! I did it. Countdown is in the upper right corner.
I blurred the photo. They are fans of “Star Wars”
Screenshot_Countdown

3 Likes

Perfect !

No problem :slight_smile:
Have a great week !

1 Like

Finally, this is what I did :

(floor((((“Event UTC Timestamp in seconds”-([UTC_TS]/1000))/60)/60)/24)) j
(floor((((“Event UTC Timestamp in seconds”-([UTC_TS]/1000))/60)/60)%24)) h
(floor((((“Event UTC Timestamp in seconds”-([UTC_TS]/1000))/60)%60))) mn
(floor((((“Event UTC Timestamp in seconds”-([UTC_TS]/1000))%60)))) s

Thanks Tomas.

1 Like

I used your equations for my clock face and set the countdown to the New Year. In WFS, I see that it works. But when I assemble the watch face and send it to my Galaxy Watch 4 Classic 46mm, I see that the seconds and minutes counters get stuck and do not update on time. So I was looking for another solution. And I found it)) Since the countdown of minutes and seconds does not depend on the appointed date, I used simple calculations:
Minutes:

(59-[MIN])

Seconds:

(59-[SEC])

I’m new to WFS. I am trying to display the number of days until Christmas. I installed Google Clock app and got it to work with “Countdown to date.” But it displays “227d” and I would like “227 days”. I don’t understand the UTC Timestamp very well, but I feel that may be a better solution to allow me to add “days”. Suggestions?

Hi. You can use EpochConverter. Search for it on Google. Insert Christmas date and take epoch timestamp.

Subtract [UTC_TS] from epoch timestamp of Christmas to get seconds left till event happens. You can use expressions above so you can get it quicker. Notice that you will get seconds left in UTC so you’ll probably want to adjust it by your time zone difference.

1 Like

Sorry to be a noob.
I am using (floor((((1703480400-([UTC_TS]/1000))/60)/60)/24)) and the Google Clock app to use “Count down to date” for December 25, 2023 and I am getting 225d and I want 225 days.

EDIT : I figured it out. I don’t need to mess with the UTC stuff. Just use a Long Text and the “Countdown to date” from the Google Clock app and it works perfectly.

Just add ‘Days’ and you will have it working, no need for complication. But I think complication will have less impact on battery so me personally would use it too.

(floor((((1703480400-([UTC_TS]/1000))/60)/60)/24)) Days

3 Likes