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

Year 2038 #25

Open
chironb opened this issue May 23, 2021 · 0 comments
Open

Year 2038 #25

chironb opened this issue May 23, 2021 · 0 comments

Comments

@chironb
Copy link

chironb commented May 23, 2021

This app is great!

Had a bit of a problem using it. It appears that it suffers from the Year 2038 issues:

The Year 2038 problem (also called Y2038, Epochalypse, Y2k38, or Unix Y2K) relates to representing time in many digital systems as the number of seconds passed since 00:00:00 UTC on 1 January 1970 and storing it as a signed 32-bit integer. Such implementations cannot encode times after 03:14:07 UTC on 19 January 2038.

When you add a date that happens in the future and it's past the 2038 epoch, the program thinks you've entered a date in the past instead, and gives an error about the "...date is greater than or equal to the end date...".

Also, the text gets cut-off when trying to display this text. This may be a separate layout issue.

I believe the problem is in the file:
https://github.com/rickybassom/date-countdown/blob/master/src/MainWindow.vala

And might be some of this code:

private string? validate_input (string title, int end_date, int start_date) {
    if (title == "") return _("Enter title");
    if (start_date >= end_date) return _("Start date is greater than or equal to the end date");
    if (end_date < (int) get_time_now ().to_unix ()) return _("End date is smaller than or equal to the current date");
    if (start_date > (int) get_time_now ().to_unix ()) return _("Start date is greater than the current date");
    return null;
}   

And might also be some of this code:

private int unix_to_days (int unix_time) {
int days = (int) Math.ceil ((double) unix_time / (double) seconds_in_min);
return days;
}

I'm guess it's anywhere an "int" is used and probably needs whatever a 64-bit integer would be. I'm not a Vala programmer, I just play one on TV, :-)

Thanks!

  • Chiron
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

1 participant