'Returns the equation of time in minutes decimal.
'x = Date in Ticks, such as DateTme.Now
Public Sub GetEOT(x As Long) As Double
'ref [url=http://en.wikipedia.org/wiki/Equation_of_time]Equation of time - Wikipedia, the free encyclopedia[/url]
Dim w, a, b, c As Double
Dim n As Int
n = DateTime.GetDayOfYear(x)
w = 360 / 365.242199
a = w * (n + 10)
b = a + 1.9149659 * SinD(w * (n-2)) '1.91... = 360 / cPI * 0.0167... ecc of earth
c = (a - ATanD(TanD(b) / CosD(23.43755447))) / 180
Return 720 * (c - Round(c))
End Sub