mitxela.com forum
Welcome. Please log in or register.

How does the countdown mode work?
solarzone Posted: 6 Jun 2025, 04:03 AM
Avatar


Member
Posts: 2
Joined: 5-June 25
Well, this might be a bit specific, but I'm asking specifically about the division into years, months, and days.
Consider that it is 2022-03-03T00:00, and the countdown is set for 2022-03-31T00:00: should it say that there is one month left? After all, one month before is "31st February", or 3rd March 2022. But is that how the clock calculates it? It is a bit odd...

-------------
[top]
mit Posted: 6 Jun 2025, 11:18 AM
Avatar
yeah whatever

Admin
Posts: 618
Joined: 4-May 16
It only shows the number of whole days remaining, for the reasons you point out. I suppose it could show whole years and remaining days, but months is just ambiguous.

Countdown is calculated here and the date display is sent just a few lines above it:

  case MODE_COUNTDOWN:
i = sprintf((char*)&uart2_tx_buffer[1], "t-%7ldd", countdown_days);


-------------
[top]
solarzone Posted: 6 Jun 2025, 10:52 PM
Avatar


Member
Posts: 2
Joined: 5-June 25
ah, thanks! I guess I must've misremembered something...
Also, even years would be problematic because of leap days: is 01 Mar 2019 to 29 Feb 2020 "one year" or "365 days"? In most places, the birthday of someone born in 29 Feb is 01 Mar in non-leap years (in Taiwan, it's 28 Feb, I think.)

-------------
[top]

Sign in to post a reply.