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

Minutes are not correctly calculated as per timezone #1

Closed
darshan-shah-git opened this issue Sep 19, 2019 · 3 comments
Closed

Minutes are not correctly calculated as per timezone #1

darshan-shah-git opened this issue Sep 19, 2019 · 3 comments

Comments

@darshan-shah-git
Copy link
Contributor

Hi,
In convert() function of sunrise.c file, difference is not correctly added.
As example, if my timezone is +5:30, then current logic is only adding +5 Hr only. We need to add logic to add correct minutes details.
Updated Code:

static void convert(double ut, int *h, int *m)
{
   *h = (int)floor(ut);
   *m = (int)(60 * (ut - floor(ut)));

   *m += (timediff() % 3600)/60;
   *h += timediff() / 3600;
}
@darshan-shah-git darshan-shah-git changed the title Minutes are not correctly added in time difference Minutes are not correctly calculated as per timezone Sep 19, 2019
@troglobit
Copy link
Owner

Cool, never even heard about "half" timezones before! :)

Would you mind doing a pull request?

@darshan-shah-git
Copy link
Contributor Author

darshan-shah-git commented Sep 27, 2019 via email

@troglobit
Copy link
Owner

Merged to master :)

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