NATION

PASSWORD

Card find date calculations seem to be off by 1 day

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Vylixan
Chargé d'Affaires
 
Posts: 432
Founded: Mar 19, 2006
Liberal Democratic Socialists

Card find date calculations seem to be off by 1 day

Postby Vylixan » Sat Apr 01, 2023 5:30 am

This card was found at 2018-04-01, 05:57:01 CEST,
I'm at 2023-04-01 14:08:30 CEST (time is aprox)
That's about 5 years, 0 days, 8 hours, 8 minutes, and 39 seconds between both events
But NS tells me: 5 years 1 day ago: Found by The maliki caliphate
Now i know that calculating time and date differences is kind of a finicky thing to do. (See here and here for more about that problem).
But it would be nice to show the correct time diff in a non-absolute way, especially since the start of Cards is 5 years ago today.

What I think is happening here is that it's taking an absolute days and years approach, and thus also using the extra leap-year day in 2020. And then we get into the different meanings of "ago" and "year" and it gets really complicated and annoying real fast. Because if you calculate a true time diff between those two dates (probably in seconds), and then present that in a different way (by years and days) there is always going to be a variance. In absolute numbers, both datetimes are approx. 157,899,830 seconds apart from each other, this is about 5 years, 1 day, and 8 hours, this includes the extra day, but if you just do 5 years and 8 hours you get 157,813,430 seconds. (Both numbers are an approximation).

So what I would suggest, any find time over a year (365 days) is displayed in a non absolute way, instead of based on the true time difference between the two dates, which is always going to be different, this would feel close to how we use years in common parlance when celebrating events, we don't shift birthdays around when the number of days between them is not exactly 365 days after all.

I realise this is a real niche and nice2have thing to post, and not really a priority to solve anytime if at all, just wanted to mention it here.
Last edited by Vylixan on Sat Apr 01, 2023 5:32 am, edited 3 times in total.

User avatar
Ballotonia
Senior Admin
 
Posts: 5494
Founded: Antiquity
Democratic Socialists

Postby Ballotonia » Sat Apr 01, 2023 6:38 am

So... you include a video which elaborately explains 'that way lies madness' and then you request us to go there?

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Vylixan
Chargé d'Affaires
 
Posts: 432
Founded: Mar 19, 2006
Liberal Democratic Socialists

Postby Vylixan » Sat Apr 01, 2023 7:01 am

Ballotonia wrote:So... you include a video which elaborately explains 'that way lies madness' and then you request us to go there?

Ballotonia


You make a very good point.
Uhm, I shall retract my proposal. I also I had trouble getting it to work nicely in my own pseudocode when I was messing around just now.
I have no intention to make the admins any more mad then they already are :p .
Last edited by Vylixan on Sat Apr 01, 2023 7:08 am, edited 1 time in total.


Return to Technical

Who is online

Users browsing this forum: No registered users

Advertisement

Remove ads