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

[Question] How to get sunrise/sunset time? #949

Closed
sblantipodi opened this issue Sep 5, 2021 · 3 comments
Closed

[Question] How to get sunrise/sunset time? #949

sblantipodi opened this issue Sep 5, 2021 · 3 comments
Labels

Comments

@sblantipodi
Copy link

Hi,
how can I get the sunrise/sunset time?

I know that it can be possible by knowing the GPS coordinates, but how can I get the GPS coordinates? :)

@MenoData
Copy link
Owner

You can calculate sunrise and sunset based on the class SolarTime. Its documentation contains examples how to do this task using geographic latitudes and longitudes.

But I can only speculate why you ask for getting these coordinates?! Maybe you are on an Android device. If so then you might start with this older issue and the link there.

@sblantipodi
Copy link
Author

Thanks for the answer, I'm on WIndows/Linux and I don't see a "free" method to get the coordinates. :)
Without coordinates it seems that I can't get the Sunrise/Sunset that is what I am searching for.

@MenoData
Copy link
Owner

If on a Windows/Linux-platform then it is clear that a computer cannot give you in general these coordinates. You will need any kind of GPS-enabled service or device. Or you simply ask the user for those coordinates via an input mask in the user interface which is my recommendation when ever your computer does not know where it is suited resp. located.

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

No branches or pull requests

2 participants