Solved

the name DateAdd does not exist in this context

Posted on 2016-10-21
2
104 Views
Last Modified: 2016-10-21
I am new to C# as of this morning. The name DateAdd does not exist in this context ... could anybody tell me how to get rid of this error. I think i have to add something by namespaces but not sure what.
Capture.JPG
0
Comment
Question by:vbnetcoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Russ Suter earned 500 total points
ID: 41854018
You would do it like this:
            DateTime testUTC = DateTime.UtcNow;
            Row.ModifiedOut = testUTC.AddHours(intHoursDifference);

Open in new window

In .NET the DateTime object has many built-in methods for manipulating the date and time. A full list of them can be found here: https://msdn.microsoft.com/en-us/library/system.datetime_methods(v=vs.110).aspx
0
 

Author Closing Comment

by:vbnetcoder
ID: 41854129
ty
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question