Add months or days to a Date

ciginfo

Well-Known Member
Licensed User
Longtime User
Bonjour,
Excuse my bad english, i'm french.
I want to add 9 months to a date given by a DateDialog

Here my code (wrong) and impossible to find the true

Dim Dd As a DateDialog
Dim dateDG, DateTerme As Long
Dim TermeLbl As Label

dateDG = Dd.DateTicks
DateTerme = DateTime.Add(DateTime.date(dateDG), 0, 9, 0)
TermeLbl.Text = DateTime.Date(DateTerme)

Thank you if anybody give me the soluce

François
 

cirollo

Active Member
Licensed User
Longtime User
it doesn't work for me!

Hi

I would like to add 123 days to a date picked by date dialog.

tried

dateDG = Dd.DateTicks
DateTerme = DateTime.Add(dateDG, 0, 0, 123)
TermeLbl.Text = DateTime.Date(DateTerme)

but it doesn't work!
strange is that if i put

DateTerme = DateTime.Add(datetime.now, 0, 0, 123)

seems to work?!?!?!

any hint????
thanks
ciro
 
Upvote 0

cirollo

Active Member
Licensed User
Longtime User
ok, solved

Hi Erel!

now it works, my mistake!

just a question, date format in adroid is always with "." or can be used also "/" or "-" between day,month,year?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…