Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C#
Hi all,
 
I have one confusion on datetime concept that 'Difference between DateTime.Now and System.datetime.now'?
 
Thanks to all in advance
Posted 27-Feb-13 19:14pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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? Smile | :)
 
—SA
  Permalink  
Comments
Espen Harlinn at 28-Feb-13 8:19am
   
Right :-D
Sergey Alexandrovich Kryukov at 28-Feb-13 11:05am
   
Thank you, Espen.
—SA
H.Brydon at 28-Feb-13 15:30pm
   
Right.
On.
+5.
Sergey Alexandrovich Kryukov at 28-Feb-13 15:45pm
   
Thank you.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

DateTime.Now is equal to System.DateTime.Now
 

When We use
DateTime.Now
then need to declare
Using System;
in your code, but no need to add "Using" statement when you write
System.DateTime.Now
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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

so use differetently namespaces are as
 
DateTine.Now
 
and using System
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 305
1 _Amy 235
2 Peter Leow 205
3 Andreas Gieriet 180
4 Abhinav S 140
0 OriginalGriff 7,540
1 Sergey Alexandrovich Kryukov 6,462
2 Maciej Los 3,849
3 Peter Leow 3,653
4 CHill60 2,712


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100