DelphiBasics
DayOfTheMonth
Function
Gives day of month index for a TDateTime value (ISO 8601) DateUtils unit
 function DayOfTheMonth(const Date TDateTime):Word;
Description
The DayOfTheMonth function returns an index number for the day of the month.
 
Depending on the year and month, the value is in the range 1..31
Related commands
DayOfTheWeekGives day of week index for a TDateTime value (ISO 8601)
DayOfTheYearGives the day of the year for a TDateTime value (ISO 8601)
DayOfWeekGives day of week index for a TDateTime value
MonthOfTheYearGives the month of the year for a TDateTime value
 Download this web site as a Windows program.




 
Example code : Show the day of the month for a TDateTime variable
var
  myDate : TDateTime;

begin
  myDate := EncodeDate(2002, 12, 31);
  ShowMessage('The day of the month = '+IntToStr(DayOfTheMonth(myDate)));
end;
Show full unit code
  The day of the month = 31
 
Delphi Programming © Neil Moffatt 2002 - 2022. All rights reserved.  |  Home Page