title: sunrise sunset times in c
body: <p>In my C application, I want to calculate sunrise/sunset times for a given date, latitude and longitude. i have been searching on the net but i can not find a working sample.</p>
  
  <p>I tried to implement this sample:
  <a href="http://souptonuts.sourceforge.net/code/sunrise.c.html" rel="nofollow noreferrer">http://souptonuts.sourceforge.net/code/sunrise.c.html</a></p>
  
  <p>But this sample didnt work correctly.</p>
  
  <p>Is there a simple C source code or method which i can easly implement in my application?</p>
  
  <p><b>Edit:</b><br>
  I implement the code on this <a href="http://souptonuts.sourceforge.net/code/sunrise.c.html" rel="nofollow noreferrer">link</a> but it gave me the wrong sunset/sunrise values. Also i tried the Saul's link <a href="http://www.codeproject.com/KB/datetime/srss.aspx" rel="nofollow noreferrer">here</a> but it gave me the wrong result either. <br>
  I have 41N, 28E location. When i try the codes, both sample says that sunrise value is aproximately 10:13 and sunset is 23:24. But the correct values are 06:06, 20:13.<br>
  I can not understand the problem.</p>