I want to get the difference between two DateTime objects as a DateTime and not as a Period or something like that. How can I do that ?
You can't, because it doesn't make sense.
What's the difference between September 25th 2012 and December 25th 2012? It's two months, or ~60 days (I haven't checked exactly) - but it certainly isn't "February 20th 1970" or anything like that.
If you find yourself wanting the difference as a DateTime, it means something in your design is messed up, and you should revisit it. If you have trouble working out exactly where the problem is, you can give us more information and we may be able to identify where the types are wrong, but fundamentally what you're asking for won't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With