Click here to Skip to main content
15,886,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I have one confusion on datetime concept that 'Difference between DateTime.Now and System.datetime.now'?

Thanks to all in advance
Posted

DateTime.Now is not as same as System.DateTime.Now


so use differetently namespaces are as

DateTine.Now

and using System
 
Share this answer
 
DateTime.Now is equal to System.DateTime.Now


When We use
C#
DateTime.Now
then need to declare
C#
Using System;
in your code, but no need to add "Using" statement when you write
C#
System.DateTime.Now
 
Share this answer
 
Only one thing exists: System.DateTime.Now. "System" can be omitted if you used using System.

Honestly, sometimes I think that the use of "using" clause should be prohibited to some beginners, to let them understand the basics. You probably don't understand what is the type name and how namespaces work. Better read on this topic:
http://msdn.microsoft.com/en-us/library/0d941h9d.aspx[^].

You won't be able to do any reasonable software development if you don't understand this very basic and simple thing. I'm afraid to know what's next. How to use assemblies? :-)

—SA
 
Share this answer
 
Comments
Espen Harlinn 28-Feb-13 8:19am    
Right :-D
Sergey Alexandrovich Kryukov 28-Feb-13 11:05am    
Thank you, Espen.
—SA
H.Brydon 28-Feb-13 15:30pm    
Right.
On.
+5.
Sergey Alexandrovich Kryukov 28-Feb-13 15:45pm    
Thank you.
—SA

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