Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

72 years ago #99

Open
faassen opened this issue Aug 28, 2023 · 2 comments
Open

72 years ago #99

faassen opened this issue Aug 28, 2023 · 2 comments

Comments

@faassen
Copy link

faassen commented Aug 28, 2023

I am getting time information like "72 years ago", which is both unlikely and most importantly, not actually true. :)

For example, for a node_modules directory with the date Jan 19 2018 I'm getting "72 years ago". I can't explain it through a confusion with months; that's more like 67 months ago.

For items months ago, I am getting plausible time periods.

I'm on Fedora 38. I installed the tool through cargo install after cloning from git.

@faassen
Copy link
Author

faassen commented Aug 28, 2023

Looking through the source it looks like:

secs => (secs as f64 / MONTH as f64, "year"),

is dividing by months instead of years. I think the discrepancy between 72 and 67 is due to division by a hardcoded number where a month is 4 weeks and thus 28 days, versus calculating the actual duration. The year appears to consist of 336 days.

@tbillington
Copy link
Owner

Thanks for the report :) I would be impressed by a 72 year old project.

I've fixed the incorrect unit for now. The math is still not perfect but hopefully this also brings it closer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants