Adding and Subtracting


The DateTime class exposes several instance methods that let you add and subtract a number of years, months, date, hours, minutes or seconds to or from another Date.


AddYears
AddMonths
AddDays
AddHours
AddMinutes
AddSeconds
AddMilliseconds
AddTicks


You can use an integer value when you use AddYears and AddMonths and a decimal for all the others.




FromOADate

Returns a datetime equivalent to the specified OLE Automation date.


dt = new DateTime(1900,1,1).Add(38793.344); 
dt = DateTime.FromOADate(38793.344);
double = dtmyDate.ToOADate();





© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext