.Net的DateTime方法能够识别闰秒吗? [英] Are .Net's DateTime methods capable of recognising a Leap Second?

查看:129
本文介绍了.Net的DateTime方法能够识别闰秒吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用今年6月的第二次跳跃让我想知道.Net框架是否闰秒知道?额外的第二个是在6月30日的最后一秒之后插入,所以UTC将正式为:

  2012年6月30日23h 59m 59s 
2012六月30,23h 59m 60s
2012七月1,0h 0m 0s



< p框架能够处理这个吗?如果 Windows不是第二次跳跃第二感知,这是否甚至是重要的?这会影响O / S上运行的单声道应用程序 Leap Second知道吗?



编辑: p>

为了扩展这一点,我设想一个场景,其中基于Java的解决方案(即Leap Second意识到)调用.Net Web服务传递一些是Java中的有效时间戳,但对于.Net而言是超出范围的。有没有任何适应它的框架(也许像Noda时间一样)?

解决方案

否 -


单个刻度代表一百纳秒或一百万分之一秒。在一毫秒内有10,000个刻度。



此属性的值表示从1月1日午夜12:00:00起经过的100纳秒间隔, 0001,表示DateTime.MinValue。 它不包括归因于闰秒的蜱数。


来源: http://msdn.microsoft.com/en-us/library/system。 datetime.ticks.aspx


With a Leap Second on the horizon for June this year it got me wondering whether the .Net framework is leap second aware? The extra second is to be inserted after the last second of June 30th so UTC will officially be:

2012 June 30,     23h 59m 59s
2012 June 30,     23h 59m 60s
2012 July  1,      0h  0m  0s

Is the .Net framework capable of handling this? Does it even matter if Windows is not Leap Second aware? Will this affect apps in mono running on O/S's that are Leap Second aware?

EDIT:

To expand on this a little bit i'm envisioning a scenario where a Java based solution on Linux (which is Leap Second aware) calls a .Net Web Service passing in something that is a valid timestamp in Java but is out of bounds for .Net. Are there any frameworks that cater for it (Like Noda Time perhaps)?

解决方案

No -

A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond.

The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001, which represents DateTime.MinValue. It does not include the number of ticks that are attributable to leap seconds.

Source: http://msdn.microsoft.com/en-us/library/system.datetime.ticks.aspx

这篇关于.Net的DateTime方法能够识别闰秒吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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