J
Jose
Exists a function that determined between two dates the years,months and
days?
Thanks a lot.
days?
Thanks a lot.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Scott said:dim x as date = someDate.subtract(someOtherDate)
Chris said:The Subtract method on the DateTime structure, when passed another
DateTime, returns a Timespan object and not a DateTime object.
Dim ts As TimeSpan = someDate.Subtract(someOtherDate)
Then you can get the years, months, and days properties from the
TimeSpan.
Göran Andersson said:Actually, you can only get the value as days.
Chris said:I stand corrected. But when you subtract a date from another date, it
returns a Timespan and not a date.

Göran Andersson said:Yes. If you read my next sentence you see that I am referring to the
TimeSpan structure. That implies that I concur with your observation.![]()
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.