i studying TDateTime functions and procedure, but not found something that allow me to convert a number of days in equivalent Year, Month, Day, for example, if i have days = 0 i should to have as result:
Year: 0
Month: 0
Day: 0
or i have days = 1, should have:
Year: 0
Month: 0
Day: 1 // Just 1 day
or if i have days = 32:
Year: 0
Month: 1 // January is 31 days
Day: 1 // Day is 1
// Total are 32 days
etc, considering too when february month is of 29 days and not only 28.
In delphi xe2, who can tell me what function do it, or if need write it manually? Thanks very much.
Using the methods in DateUtils:
This code assumes that you are counting the days in the current year. If you want to start in a different year then modify the line
january1st := StartOfTheYear(Now());as needed.