<p>I am making a watch app, where i need to know where there is currently sun, and where its not.</p>
<p>I need to have some sort of formula/function to insert: date, time and longitude, and get back the latitude of the civil twilight.</p>
<p>Can someone help me?</p>

CC BY-SA 4.0
2021-06-22T23:47:49.867Z
You might check with people who made an online tool like https://geodesyapps.ga.gov.au/sunrise to see if they have a service or can help you with the formula.
haresfur
CC BY-SA 4.0
2021-06-23T14:52:08.947Z
you can take a look at timeanddate.com and try to find the formulas they use.
trond hansen
CC BY-SA 4.0
2021-06-24T17:47:25.963Z
I think that since the Earth is not spherical, any "formula" you use will have to be geo-referenced and thus software is required.  And that is not even taking into account the leap year problem and other time corrections you will need depending on year.  Maybe you could derive a "formula" for a specific location based on empirical evidence.
f.thorpe
CC BY-SA 4.0
2021-07-01T10:24:57.377Z
Astronomical algorithms by Meeus J. published by Willmenn-Bell Inc, USA contains the algorithm or formula you need!
Harish
<sun><astronomy><python><mathematics>
What is the formula to input date, time and longitude. Where i can get latitude of the civil twilight back?
patchie
# What is the formula to input date, time and longitude. Where i can get latitude of the civil twilight back?

(Asked by: username_0 on 2021-06-22)

I am making a watch app, where i need to know where there is currently sun, and where its not.

I need to have some sort of formula/function to insert: date, time and longitude, and get back the latitude of the civil twilight.

Can someone help me?

**Tags:** sun, astronomy, python, mathematics

> **Comments:**
> **username_1**: You might check with people who made an online tool like https://geodesyapps.ga.gov.au/sunrise to see if they have a service or can help you with the formula.  
> **username_2**: you can take a look at timeanddate.com and try to find the formulas they use.  
> **username_3**: I think that since the Earth is not spherical, any "formula" you use will have to be geo-referenced and thus software is required.  And that is not even taking into account the leap year problem and other time corrections you will need depending on year.  Maybe you could derive a "formula" for a specific location based on empirical evidence.  
> **username_4**: Astronomical algorithms by Meeus J. published by Willmenn-Bell Inc, USA contains the algorithm or formula you need!  

---

## 0 answers

