vb.net subtraction giving error message for subtracting two numbers -


i trying use code in vb.net

num_days = todate_split(0) - fromdate_split(0) 

to find out number of days between. example, todate_split(0) equals 20 , fromdate_split(0) equals 5 should return 15

but error saying:

operator '-' not defined types 'char' , 'char' 

update:

i using code too:

fromdate_split.split("/") 

to split strings

they in date format, example 30/12/2015

and want difference between 2 dates (days)

what want parse dates , timespan:

dim todate datetime = datetime.parse(todatestring) dim fromdate datetime = datetime.parse(fromdatestring)  dim diff timespan = todate - fromdate 

this way number of days with:

dim days int32 = diff.days 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -