Converting date to American format in delphi

0

I have the following code:

procedure Tfrmniver.FormCreate(Sender: TObject);
var hoje : tdatetime;
dia:Integer;
begin

//Defini a quantidade de dias
dia:=15;

// vamos obter a data de hoje
hoje := date;

// vamos subtrair 5 dias da data de hoje
hoje := IncDay(hoje, dia);

// vamos exibir o resultado
antecendia:=DateToStr(hoje);

//ShowMessage(antecendia);

end;

I need to convert the final result that is the advance variable into the American format yyyy / mm / dd because to use as a query in mysql it has the date in that American format.

Someone can help me. Oh, I tried:

hoje:=FormatDateTime('yyyy/mm/dd',now);

But without success.

Abs

    
asked by anonymous 14.05.2015 / 14:51

1 answer

1

Now you can solve it, it looks like this:

antecedencia:=FormatDateTime('yyyy/mm/dd', hoje);

Abs

    
14.05.2015 / 15:25