开发者

How can i calculate time duration between sunrise and sunset?

开发者 https://www.devze.com 2023-01-10 05:51 出处:网络
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)?
  1. My quest开发者_Go百科ion is How can i calculate time duration between sunrise and sunset?
  2. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消