Decodificação de data.
[b:9aed881d46]Quero criar um arquivo, este arquivo quero que seja salvo com a data atual.
Estou quebrando a cabeça a horas e não consigo, se alguem puder me ajudar,[/b:9aed881d46]
Estou quebrando a cabeça a horas e não consigo, se alguem puder me ajudar,[/b:9aed881d46]
Eduardo_lcouto
Curtidas 0
Respostas
Lucas Silva
05/01/2004
é só você colocar o nome do arquivo assim:
var nome: String;
begin
nome := ´arquivo´+DateToStr(Date);
end;
Lucas!
var nome: String;
begin
nome := ´arquivo´+DateToStr(Date);
end;
Lucas!
GOSTEI 0
Aroldo Zanela
05/01/2004
Colega,
Pode detalhar melhor o que você quer? É gravar o arquivo com nome formado pela data atual?
Pode detalhar melhor o que você quer? É gravar o arquivo com nome formado pela data atual?
GOSTEI 0
Motta
05/01/2004
tente algo assim com
DateToStr ou DecodeDate
Label1.Caption := ´Today is ´ + DateToStr(Date);
procedure TForm1.Button1Click(Sender: TObject);
var
Present: TDateTime;
Year, Month, Day, Hour, Min, Sec, MSec: Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
Label1.Caption := ´Today is Day ´ + IntToStr(Day) + ´ of Month ´
+ IntToStr(Month) + ´ of Year ´ + IntToStr(Year);
DecodeTime(Present, Hour, Min, Sec, MSec);
Label2.Caption := ´The time is Minute ´ + IntToStr(Min) + ´ of Hour ´
+ IntToStr(Hour);
end;
DateToStr ou DecodeDate
Label1.Caption := ´Today is ´ + DateToStr(Date);
procedure TForm1.Button1Click(Sender: TObject);
var
Present: TDateTime;
Year, Month, Day, Hour, Min, Sec, MSec: Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
Label1.Caption := ´Today is Day ´ + IntToStr(Day) + ´ of Month ´
+ IntToStr(Month) + ´ of Year ´ + IntToStr(Year);
DecodeTime(Present, Hour, Min, Sec, MSec);
Label2.Caption := ´The time is Minute ´ + IntToStr(Min) + ´ of Hour ´
+ IntToStr(Hour);
end;
GOSTEI 0
Eduardo_lcouto
05/01/2004
Valeu galera pela ajuda, a opinião do Emerson, foi a que achei melhor, abraços.
GOSTEI 0