在这里,我们将给大家分享关于Joda-Time:Period,Interval和Duration有什么区别?的知识,让您更了解duration和period的区别的本质,同时也会涉及到如何更有效地an
在这里,我们将给大家分享关于Joda-Time:Period,Interval和Duration有什么区别?的知识,让您更了解duration和period的区别的本质,同时也会涉及到如何更有效地angular – BrowserAnimationsModule和NoopAnimationsModule之间有什么区别?、c# – ConfigurationManager.GetSection和Configuration.GetSection有什么区别?、c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?、c#中的DateTime和SQL Server中的DateTime有什么区别?的内容。
本文目录一览:- Joda-Time:Period,Interval和Duration有什么区别?(duration和period的区别)
- angular – BrowserAnimationsModule和NoopAnimationsModule之间有什么区别?
- c# – ConfigurationManager.GetSection和Configuration.GetSection有什么区别?
- c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?
- c#中的DateTime和SQL Server中的DateTime有什么区别?
Joda-Time:Period,Interval和Duration有什么区别?(duration和period的区别)
在Joda-Time 2中,三种时间跨度之间有什么区别:
- 期
- 间隔
持续时间
为什么我们需要三堂课?
哪一个表现更好?
为什么不实现对Period,Duration或Interval实例的 划分 ?例如
p = p.divideBy(2);
答案1
小编典典需要3个类,因为它们表示不同的概念,因此,选择适合工作的类而不是相对性能是一个问题。从文档中,我用 斜体 添加了注释:
的 间隔 在约达时间表示时间从一个毫秒时刻到另一时刻的间隔。这两个时刻都是日期时间连续体中完全指定的时刻,并带有时区。
定义了特定时间,例如,这可能是昨天20:00:00GMT和今天早上09:00:00GMT之间的时间间隔。
甲 持续时间 在约达时间表示以毫秒计的时间的持续时间。持续时间通常是从一个间隔中获得的。 即我们可以从间隔结束处减去开始以得出持续时间
甲 期间
在约达时间表示一段时间中的字段来定义,例如,3年5月2天及7小时。这与持续时间的不同之处在于,它以毫秒为单位不精确。通过指定相对的瞬间(包括时间和时区),只能将一个时期解析为精确的毫秒数。
例如,考虑一年的期限,如果将其添加到1月1日,我们将始终到达下一个1月1日,但是持续时间取决于中间年份是否为a年。
同样,如果我们在一个月的1号加上1个月,那么我们将在下个月的1号到达,但是持续时间(以毫秒为单位)将根据相关月份而有所不同
对于问题3,确实没有必要使用特定的方法来划分持续时间,因为我们总是可以从持续时间中获取毫秒数long
(使用getMillis()
),对其进行划分并构造新的持续时间(使用newDuration(long duration)
)。
根据上述期间的定义,划分期间实际上并没有真正的意义。例如,半个月是什么?(其长度取决于哪个月)。
angular – BrowserAnimationsModule和NoopAnimationsModule之间有什么区别?
Some Material components depend on the Angular animations module in
order to be able to do more advanced transitions. If you want these
animations to work in your app,you have to install the
@angular/animations module and include the browserAnimationsModule in
your app.06000
If you don’t want to add another dependency to your project,you can use the NoopAnimationsModule.
06001
我不太明白这里有什么区别.似乎完全一样:)两个模块之间有什么区别?
这对于动画速度太慢的平台或单元测试非常方便,如果动画不涉及您实际想要测试的内容.
c# – ConfigurationManager.GetSection和Configuration.GetSection有什么区别?
<configSections> <section name="customConfiguration" type="System.Configuration.AppSettingsSection,System.Configuration,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"/> </configSections>
当我尝试通过ConfigurationManager.GetSection(“customConfiguration”)读取它时,返回的对象是System.Configuration.keyvalueInternalCollection类型.我无法读取此集合的值,虽然我可以看到键,但我无法将其转换为AppSettingsSection.
This Stackoverflow回答建议我应该使用
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); AppSettingsSection customSettingSection = (AppSettingsSection)config.GetSection("customConfiguration");
这很有效.我的问题是:ConfigurationManager.GetSection()和Configuration.GetSection()之间有什么区别?我何时应该使用另一个?何时应该使用另一个?
解决方法
If your application needs read-only access to its own configuration,it is recommended that you use the 07001 method overloads for Web applications. For client application,use the 07002 method.
These methods provide access to the cached configuration values for the current application,which has better performance than the Configuration class.
具体来说,在客户端应用程序中,ConfigurationManager检索通过合并应用程序配置文件,本地用户配置文件和漫游配置文件获得的配置文件.
c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?
EntityFunctions.TruncateTime
和
DbFunctions.TruncateTime methods?
解决方法
对于从6.0开始使用EF版本的任何新应用程序,您应该使用DbFunctions类,因为其他类(和大部分内置的EF库)已被废弃,有利于单独部署的版本.
这两个函数只是代理调用,它们被转换为Entity Framework模型中的底层规范函数,最终转换为sql调用.
c#中的DateTime和SQL Server中的DateTime有什么区别?
c#中的DateTime和SQL Server中的DateTime有什么区别?
答案1
小编典典精度和范围(因此,所有重要;-p)
从MSDN:
.NET System.DateTime
DateTime值类型表示日期和时间,值的范围为0001年1月1日午夜12:00:00 Anno
Domini(公共时代)至9999年12月31日(CE)的11:59:59 PM时间值以100纳秒为单位进行测量,称为“滴答”,特定的日期是自公历0001年1月1日午夜12:00(公元001年)以来的滴答数。
Transact SQL日期时间
日期范围:1753年1月1日至9999年12月31日
精度:四舍五入为.000,.003或.007秒
关于Joda-Time:Period,Interval和Duration有什么区别?和duration和period的区别的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于angular – BrowserAnimationsModule和NoopAnimationsModule之间有什么区别?、c# – ConfigurationManager.GetSection和Configuration.GetSection有什么区别?、c# – EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法有什么区别?、c#中的DateTime和SQL Server中的DateTime有什么区别?等相关内容,可以在本站寻找。
本文标签: