Hi Guys,,, I'm try to calculated due date betwen two date but I'm can't solve this trouble. I'm found the refrence code in VB and then I'm try to translate that code to C#. Anny help could be appriciate.
this isi code to calculated due date betwen two date in VB.NET
Code
'find maturities based on installments to ???
DueDate.Text = DateAdd(DateInterval.Month, Val(InstallmentsTo.Text), DateValue(RentDate.Text))and then I'm try translate that code in C#. But this code not working
Code
//find maturities based on installments to ???private void SearchDueDate(){System.DateTime PaymentDate;System.DateTime RentDate;int InstallmentsTo;InstallmentsTo = Convert.ToInt32(txtcicilan_ke.Text);RentDate = Convert.ToDateTime(txttgl_pinjaman.Text);PaymentDate = Convert.ToDateTime(txttanggal_pembayaran.Text);DueDate.Text = Convert.ToDateTime(PaymentDate - RentDate), InstallmentsTo.ToString("yyyy/MM/dd");}

Pranam BhatRank #500 · 4.9K reputationPosted Jun 7, 2021, 2:51 AM EDT
Demo :
https://dotnetfiddle.net/M6AjL8
https://www.c-sharpcorner.com/UploadFile/0c1bb2/duration-calculator-between-two-dates-using-Asp-Net-C-Sharp/
Tri SetiaRank #4,571 · 337 reputationPosted Jun 7, 2021, 7:41 AM EDT
Tri SetiaRank #4,571 · 337 reputationPosted Jun 13, 2021, 1:53 AM EDT