Arsip: penjumlahan tanggal

 
user image
more 16 years ago

hafiezd

maaf mas-mas semua.... mungkin pertanyaan saya basi. 1. bagaimana cara menjumlahkan karakter dengan tanggal contoh : 3 (hari) + 02/04/2009=??? (dengan hasil 05/04/2009) 2. penjumlahan tanggal dengan tanggal... ok mas... thanks b4
user image
more 16 years ago

herux

Guuuuaaampang bangeeeett. pasti blom buka delphi help niihh??
user image
more 16 years ago

herux

Guuuuaaampang bangeeeett. pasti blom buka delphi help niihh?? di unit DateUtils ?
user image
more 16 years ago

tstringlist

@herux: Guuuuaaampang bangeeeett. pasti blom buka delphi help niihh?? di unit DateUtils ?
gak usah pakek DateUtils juga bisa, yang dihitung itu adalah string jadi harus di ubah dulu. coba deh liat contoh codingan ku, mungkin seperti ini yang dimaksud mas herux, atau mungkin udah ketemu solusinya.

procedure TForm1.Button1Click(Sender: TObject);
var s:string;
    hasil:TDate;
begin
  // 3 (hari) + 02/04/2009=??? (dengan hasil 05/04/2009)
  s := '3 (hari)'; 
  s:=Copy(s,0,Pos(' ',s)-1); //3 (hari) => 3
  hasil:=StrToDate('02/04/2009')+StrToInt(s); // 3 + 02/04/2009 
  ShowMessage(DateToStr(hasil)); // 05/04/2009
end;
more ...
  • Pages:
  • 1
Share to

AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now: https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com