使用HebrewCalendar()在.net中进行希伯来语日期转换 [英] Hebrew date conversion in .net using HebrewCalendar()
问题描述
我正在尝试使用 HebrewCalendar()库获取任何特定日期的希伯来周年日期。它给出了某些日期的错误周年日期。示例:对于日期: 2018-03-22
周年日期: 2019年4月11日。但是以下程序提供的日期不正确:2019年3月13日
I am trying to get Hebrew anniversary date for any specific date using HebrewCalendar() library. It is giving incorrect anniversary date for some dates. Example: For the date: 2018-03-22 anniversary date: April 11, 2019. But below program gives incorrect date: March 13, 2019
HebrewCalendar HebCal =
< span style ="font-size:9.5pt; font-family:Consolas; color:blue"> new HebrewCalendar();
DateTime dtAnyDateEnglish;
dtAnyDateEnglish = DateTime.Parse( " 2018-03-22" );
int hebYear = HebCal.GetYear(dtAnyDateEnglish);
int hebMonth = HebCal.GetMonth(dtAnyDateEnglish);
int hebDay = HebCal.GetDayOfMonth(dtAnyDateEnglish);
DateTime DT =
新 HebrewCalendar()。ToDateTime(HebCal.GetYear(DateTime.Today),hebMonth,hebDay,0,0,0,0,System.Globalization.HebrewCalendar.CurrentEra);
Console.WriteLine(DT.ToString());
请使用.net库找到正确的周年纪念日。
推荐答案
对于我们这些做的人不明白什么是希伯来周年纪念日,你能否定义规则,即约会日期X周年日为Y?
For those of us who do not understand what a Hebrew anniversary date is can you define the rules that says given date X the anniversary date is Y?
这篇关于使用HebrewCalendar()在.net中进行希伯来语日期转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!