How does the increment operator (++) work on DateTime in C#

Posted by sohtimsso1970 on Stack Overflow See other posts from Stack Overflow or by sohtimsso1970
Published on 2010-12-24T13:50:12Z Indexed on 2010/12/24 13:54 UTC
Read the original article Hit count: 142

Filed under:
|
|

What happens if you use the increment operator (++) on a DateTime type in C#?

For instance, if I did this:

DateTime blah = new DateTime(2010, 12, 24);

blah++;

What does blah become? Does that increment by a tick or a day?

Or is that even legal?

I don't have a dev environment around, and won't for a few days, or I would just try it and find out. I was too curious to wait so I figured I'd ask the community.

© Stack Overflow or respective owner

Related posts about c#

Related posts about datetime