Hi
How to format the given date to required format?
How to use the function of dateadd and datediff of vb.net in c#.net?
Please anyone give the code as Iam new to c#.
Thanks
Aruna
Date Formats
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

AlanRank #669 · 3.6K reputationPosted Jun 27, 2007, 4:44 AM EDT
These two links give details of the standard and custom date/time formats available in the .NET Framework and hence to a C# program:
http://msdn2.microsoft.com/en-us/library/az4se3k1(vs.80).aspx
http://msdn2.microsoft.com/en-us/library/8kb3ddd4(vs.80).aspx
The DateTime.Add(), and related methods, give you the same functionality as VB's DateAdd() function and the DateTime Subtraction operator, which yields a TimeSpan, can be used in place of DateDiff():
http://msdn2.microsoft.com/en-us/library/system.datetime_methods(vs.80).aspx
It's also possible to call those functions directly from a C# program but, as this is not really recommended, I won't describe it here.