I’m new in C# and I need to understand how create a DateTime object that equal the (DateTime.NOW + 1 hour).
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally speaking, you can
AddaTimeSpanvalue that represents any arbitrary interval to aDateTime. There are helper methods onTimeSpanthat help you construct such values, for example:Apart from that, since you only want the simple “+1 hour” you can also use
AddHours: