Mega Code Archive

 
Categories / Delphi / Functions
 

Dayofthemonth - 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 DayOfTheWeek Gives day of week index for a TDateTime value (ISO 8601) DayOfTheYear Gives the day of the year for a TDateTime value (ISO 8601) DayOfWeek Gives day of week index for a TDateTime value MonthOfTheYear Gives the month of the year for a TDateTime value 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