Ver Mensaje Individual
  #3  
Antiguo 25-02-2008
Avatar de maximo_nashir
maximo_nashir maximo_nashir is offline
Miembro
 
Registrado: ene 2004
Ubicación: República dominicana
Posts: 55
Reputación: 21
maximo_nashir Va por buen camino
//Para el que lo quiera hacer con las versiones anteriores
//a Delphi 7, aquí les va el codigillo:

function DiasDeUnMes(const wYear, wMonth: Word): Word;
begin
Result := MonthDays[(wMonth = 2) and IsLeapYear(wYear), wMonth];
end;

function DiasEnMes(const dFecha: TDateTime): Word;
var
wYear, wMonth, wDay: Word;
begin
DecodeDate(dFecha, wYear, wMonth, wDay);
Result := DiasDeUnMes(wYear, wMonth);
end;
//Y PARA QUE SE EJECUTE LA FUNCION QUE SE CREÓ PONDRAN ESTE CODIGO:
DiasEnMes(DateEdit1.Date);
//Y ENTONCES ESTA FUNCIÓN TE LANZARÁ LOS DIAS QUE
//CONTIENE CUALQUIER MES, SEA EL AÑO VICIESTO O NO, ESPERO LES SIRVA
Responder Con Cita