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

后端 未结 7 514
春和景丽
春和景丽 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:02

    You don't need a loop, calculate seconds from 1 Jan 0001 to unix epoch start (1 Jan 1970 00:00:00), and save somewhere. Then subtract it from your input, then use any tool available to convert unix timestamp (seconds from 1 Jan 1970) to years, then add 1970. I don't know much VB programming to post a detailed guide.

提交回复
热议问题