DelphiBasics
DaysInAYear
Function
Gives the number of days in a year DateUtils unit
 function DaysInAYear(const Year Word):Word;
Description
The DaysInAYear function gives the number of days in a given Year.
 
The Year can be in the range 0..9999
Related commands
DaysBetweenGives the whole number of days between 2 dates
DaysInAMonthGives the number of days in a month
DaySpanGives the fractional number of days between 2 dates
MinsPerDayGives the number of minutes in a day
MonthDaysGives the number of days in a month
SecsPerDayGives the number of seconds in a day
 Download this web site as a Windows program.




 
Example code : How many days in the leap year 2000 ?
begin
  // How many days in the leap year 2000?
  ShowMessage('Days in 2000 = '+
              IntToStr(DaysInAYear(2000)));
end;
Show full unit code
  Days in 2000 = 366
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page