miércoles, 25 de noviembre de 2015

fechas delphi dia mes año

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, DateUtils;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
diadelasemana: integer;
wAnyo, wMes, wDia: Word;
begin

  DecodeDate( now(), wAnyo, wMes, wDia );

  diadelasemana:=DayOfWeek(now);

 // if ((diadelasemana=7) or (diadelasemana=1)) then



 ShowMessage(datetostr(EndOfTheMonth(now())));


  if (wMes=10) then
  begin

    if (wDia>=25) then
    begin
      ShowMessage(inttostr(wDia));
      ShowMessage(inttostr(wMes));
      ShowMessage(inttostr(wAnyo));
    end;

  end;


end;

end.




//*********
procedure TForm1.Button1Click(Sender: TObject);
var
wHor, wMin, wSeg, wMSeg, wAnyo, wMes, wDia: Word;
begin

DecodeDate( now(), wAnyo, wMes, wDia );
DecodeTime( now(), wHor, wMin, wSeg, wMSeg);

ShowMessage(inttostr(wHor)+inttostr(wMin)+inttostr(wSeg)+inttostr(wMSeg));

end;
 



.
 

No hay comentarios: