How can i calculate time duration between sunrise and sunset?
- My quest开发者_Go百科ion is How can i calculate time duration between sunrise and sunset?
- Then how can i divide this duration(sunrise to sunset) into 8 equal parts(Hr: Min)?
All i need is starting and ending time of every part. And i want to write this code in VB.NET because in VB.NET i can easily design the GUI.
Thanks
A quick search for "sunrise VB.NET" came up with a few results, such as this one.
You can use TimeSpan. Add the sunrise and sunset to it, and then use timespan.Seconds, timespan.Hours etc To devide it into 8 equal parts, just use timespan.Seconds / 8 and then calculate that into hours, minutes and seconds
If you don't already have the sunrise and sunset time, you can use this project to calculate it: http://www.codeproject.com/KB/cs/SunTime.aspx
精彩评论