|
-
May 15th, 2010, 06:48 AM
#1
Thread Starter
Lively Member
how to calculate date in vb.net
hi i am developing a banking software in vb.net...
i have a two maskedtextbox, one textbox named as masktxtdepostdate and , masktxtmaturitydate, txtnoofmonth.
i changed maskedtextbox property as date, in format "YYYY-MM-DD";
now i need to calculate masktxtmaturitydate after entering the values in, masktxtdepostdate and txtnoofmonth.
calculation formula is
masktxtmaturitydate = masktxtdepostdate + txtnoofmonth
for example
masktxtdepostdate.text="2009-05-26" and txtnoofmonth.text= 13
after enering no of months in txtnoofmonth.text i need to calculate maturitydate as
masktxtmaturitydate.text="2010-06-26"
how can i code for this........
-
May 15th, 2010, 07:07 AM
#2
New Member
Re: how to calculate date in vb.net
cdate(masktxtdepostdate).AddMonths(13)
-
May 15th, 2010, 08:05 AM
#3
Re: how to calculate date in vb.net
I did not know you could set the mask of the masked textbox to YYYY-MM-DD and have it be meaningful. I thought you had to do 0000-00-00.
For your textbox with some number of months, look at Integer.TryParse.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|