转换日历对方使用NodaTime库 [英] Convert calendars to each other Use NodaTime library
问题描述
我使用野田的时间来处理的DateTime
的问题,我看了几乎所有的文件但我有一些问题历法转换成对方,
-
首先,有多少日历是由野田支持?
由于
CalendarSystem
说,有仅4日历:
一)CopticCalendar / b)的GregorianCalendar / C)IslamicCalendar / d)的儒略历
因此,如何对其他日历系统?
-
我使用波斯日历又名贾拉利日历,那么,有没有办法使用此日历NodaTime?而如何将其转换为阳历?
-
对我来说,最终的目标是无论时间(特区)和Date转换为UTC时区和格鲁吉亚日历。例如立即(
YYYY / MM / DD - HH:MM:SS
)的亚洲/德黑兰
时区和波斯日历是:(1391年6月30日 - 10时01分15秒)和立即在格鲁吉亚日历和UTC是(2012年9月20日 - 5时01分15秒),所以你有什么建议吗?时间不单独在所有问题,但到目前为止,我没有它(在NodaTime)的任何想法,有没有什么办法来这两个转换一个过程或方法?
-
是的,目前这些都是我们支持的唯一的日历系统
-
没有,我们没有为此刻的波斯日历的支持。您可以提交功能请求,但我们更可能有兴趣获得1.0出了门下手,我怕。
-
目前还不清楚你所说的特区的意思 - 但它再次听起来,你需要为这个波斯日历真正发挥作用。如果.NET支持的波斯历法,您可以将其解析到
的DateTime
第一,然后将其转换为野田时间型......对不起,我们不要科技支撑此刻的波斯历法,而且我的如的,以便能够通过包装类型(就像我们做的TimeZoneInfo
),但不会被任何时间很快,我害怕。
I use Noda Time to handle DateTime
issues, I read almost all of the documents but I have some problem to convert calendars to each other,
First, how many calendars are supported by Noda?
As
CalendarSystem
says there is just 4 calendars:a)CopticCalendar / b)GregorianCalendar / c)IslamicCalendar / d)JulianCalendar
so how about other calendar systems?
I use Persian Calendar aka Jalali Calendar, So is there any way to use this calendar in NodaTime? And how Convert it to Gregorian Calendar?
The final goal for me is to convert both Time(in special Zone) and Date to UTC Time Zone And Georgian Calendar. For example Now(
yyyy/MM/dd - HH:mm:ss
) inAsia/Tehran
time Zone And Persian Calendar is: (1391/06/30 - 10:01:15) and Now in Georgian Calendar and UTC is (2012/09/20 - 05:01:15), so what is your suggestion? The time individually not matter at all, but the Date, I don't have any idea about it(In NodaTime), and is there any way to convert both of these in one process or method?
Yes, currently those are the only calendar systems we support.
No, we don't have any support for the Persian Calendar at the moment. You can file a feature request, but we're more likely to be interested in getting 1.0 out of the door to start with, I'm afraid.
It's not clear what you mean by "special zone" - but it sounds like again, you'd need the Persian calendar for this to really work. If .NET supports the Persian calendar, you could parse it to a
DateTime
first, and then convert that to a Noda Time type... I'm sorry that we don't support the Persian calendar at the moment, and I'd like to be able to support the BCL calendars via wrapping types (as we do forTimeZoneInfo
) but that won't be any time soon, I'm afraid.
这篇关于转换日历对方使用NodaTime库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!