Click here to Skip to main content
15,917,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Assalamualaikum...
i am getting this error.Kindly help me.

<b>Error 18 Operator '+' cannot be applied to operands of type 'System.DateTime' and 'int'</b>
Posted

1 solution

This error means you can't simply add a integer to the datetime object.

Depending on what your integer means you can use the
functions:

DateTime now = DateTime.Now;
now.AddDays(1);
now.AddHours(2);
now.AddMilliseconds(3);
...

To add a defined value to your datetime object
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900