Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 21-09-2005
adlfv adlfv is offline
Miembro
 
Registrado: may 2005
Posts: 39
Poder: 0
adlfv Va por buen camino
Hola.

Creo recordar que para ese tipo de cosas viene bien DateUtils...

Yo me hice unas funciones hace tiempo a mano, pero creo que en DateUtils hay funciones para hacer eso, y más... De todas formas si no consigues, aquí te adjunto el código que hice...

Código:
 // Devuelve true sii F1 representa la misma fecha que F2
 function Iguales(F1, F2: TDate): Boolean;
 begin
   Result := (Abs(StrToInt(FormatDateTime('YYYY', F1)) - StrToInt(FormatDateTime('YYYY', F2))) = 0) and
 		    (Abs(StrToInt(FormatDateTime('M', F1)) - StrToInt(FormatDateTime('M', F2))) = 0) and
 		    (Abs(StrToInt(FormatDateTime('D', F1)) - StrToInt(FormatDateTime('D', F2))) = 0)
 end;
 
 // Devuelve true sii F1 representa una fecha mayor que la fecha F2
 function Mayor(F1, F2: TDate): Boolean;
 begin
   Result := (StrToInt(FormatDateTime('YYYY', F1)) - StrToInt(FormatDateTime('YYYY', F2)) > 0) or
 		    ((StrToInt(FormatDateTime('YYYY', F1)) - StrToInt(FormatDateTime('YYYY', F2)) = 0) and
 			 (DateToJuliana(F1) - DateToJuliana(F2) > 0));
 end;
 
 // Devuelve true sii F1 representa una fecha menor que la misma fecha F2
 function Menor(F1, F2: TDate): Boolean;
 begin
   Result := Mayor(F2, F1);
 end;
Espero que te sirva.

Un saludo...
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 04:11:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi