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
Post a Comment