DateTime.Now和System.datetime.now之间的区别 [英] difference between DateTime.Now and System.datetime.now

查看:222
本文介绍了DateTime.Now和System.datetime.now之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我对日期时间概念有一个混淆'' DateTime.Now和System.datetime.now之间的差异 ''?



感谢所有提前

解决方案

只存在一件事: System.DateTime.Now 。如果您使用使用System ,则可以省略System。



老实说,有时候我认为使用一些初学者应该禁止使用条款,让他们了解基础知识。您可能不明白什么是类型名称以及命名空间如何工作。更好地阅读这个主题:

http://msdn.microsoft.com/ en-us / library / 0d941h9d.aspx [ ^ ]。



如果你不理解这个非常基本和简单的东西,你将无法做任何合理的软件开发。我很害怕知道下一步是什么。如何使用组件? :-)



-SA


DateTime.Now等于System.DateTime.Now





当我们使用

 DateTime.Now 

然后需要声明< pre lang =c#>在代码中使用System;

,但在编写

 System.DateTime.Now  


DateTime.Now与System.DateTime.Now不同





所以使用不同的命名空间是



DateTine.Now



并使用System


Hi all,

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

Thanks to all in advance

解决方案

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


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


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


so use differetently namespaces are as

DateTine.Now

and using System


这篇关于DateTime.Now和System.datetime.now之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆