Cita:
Empezado por Gamael Hdez
a mi se me oscurre una forma rapida con el formatdatetime('dd',strtodate('22/07/2010')) ahi obtienes el 22 , formatdatetime('mm',strtodate('22/07/2010')) el 07 y formatdatetime('yyyy',strtodate('22/07/2010')) el 2010 , es una manera facil, rapida y sencilla.
|
dime tu que es más facil:
Método 1:
Código Delphi
[-]
....
var Year, Month, Day: Word;
...
Year := StrToInt(FormatDateTime('yyyy', Now));
Month := StrToInt(FormatDateTime('mm', Now));
Day := StrToInt(FormatDateTime('dd', Now));
.......
Método 2:
Código Delphi
[-]
....
var Year, Month, Day: Word;
...
DecodeDate(Now, Year, Month, Day);
.......