Need a formula: Extracting Years from Seconds Since January 1, 0001 12:00 AM

后端 未结 7 472
春和景丽
春和景丽 2021-01-12 05:22

Input: # of seconds since January 1st, of Year 0001

Output: # of Full years during this time period

I have developed an algorithm that I do not think is the

7条回答
  •  逝去的感伤
    2021-01-12 06:13

    Const TICKS_PER_YEAR As Long = 315360000000000
    Function YearsSinceBeginningOfTimeUntil(ByVal d As DateTime) As Integer
        Return Math.Floor(d.Ticks / TICKS_PER_YEAR)
    End Function
    

提交回复
热议问题