.net - Automatic days count in vb.net -
i trying find way auto calculated no of days between 2 days.
example: if create entry let's id 500 on 1st july, 2016
, saved it. again, after 15 days, i.e. opened id 500 on 15th july, 2016
, value field should show "15" including 15th july. in same way, if open id on 20th july, 2016
, should show "20".
i tried datediff function not auto calculating.
me.txtndays.text = datediff(dateinterval.day, now, metxtdtenter.text)
any appreciated.
thank in advance
well there 14 days between 1st july , 15th july.
to calculate can subtract 1 date other result in timespan
, find totaldays
this:
dim originaldate date = #2016-07-01# 'get value database dim testdate date = #2016-07-15# 'this date want compare to. use datetime.now use current date dim daysbetween = (testdate - originaldate).totaldays '14
Comments
Post a Comment