<bdo id='a1rOu'></bdo><ul id='a1rOu'></ul>
<tfoot id='a1rOu'></tfoot>

    1. <i id='a1rOu'><tr id='a1rOu'><dt id='a1rOu'><q id='a1rOu'><span id='a1rOu'><b id='a1rOu'><form id='a1rOu'><ins id='a1rOu'></ins><ul id='a1rOu'></ul><sub id='a1rOu'></sub></form><legend id='a1rOu'></legend><bdo id='a1rOu'><pre id='a1rOu'><center id='a1rOu'></center></pre></bdo></b><th id='a1rOu'></th></span></q></dt></tr></i><div id='a1rOu'><tfoot id='a1rOu'></tfoot><dl id='a1rOu'><fieldset id='a1rOu'></fieldset></dl></div>

    2. <legend id='a1rOu'><style id='a1rOu'><dir id='a1rOu'><q id='a1rOu'></q></dir></style></legend>
      1. <small id='a1rOu'></small><noframes id='a1rOu'>

        将日期从波斯语转换为公历

        时间:2023-08-26

          <tbody id='HyAjj'></tbody>

          <bdo id='HyAjj'></bdo><ul id='HyAjj'></ul>
          • <small id='HyAjj'></small><noframes id='HyAjj'>

          • <tfoot id='HyAjj'></tfoot>

              <i id='HyAjj'><tr id='HyAjj'><dt id='HyAjj'><q id='HyAjj'><span id='HyAjj'><b id='HyAjj'><form id='HyAjj'><ins id='HyAjj'></ins><ul id='HyAjj'></ul><sub id='HyAjj'></sub></form><legend id='HyAjj'></legend><bdo id='HyAjj'><pre id='HyAjj'><center id='HyAjj'></center></pre></bdo></b><th id='HyAjj'></th></span></q></dt></tr></i><div id='HyAjj'><tfoot id='HyAjj'></tfoot><dl id='HyAjj'><fieldset id='HyAjj'></fieldset></dl></div>
              • <legend id='HyAjj'><style id='HyAjj'><dir id='HyAjj'><q id='HyAjj'></q></dir></style></legend>

                  本文介绍了将日期从波斯语转换为公历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如何使用 System.globalization.PersianCalendar 将波斯日期转换为公历日期?请注意,我想转换我的波斯日期(例如今天是 1391/04/07)并获得公历日期结果,在这种情况下将是 06/27/2012.我正在数秒来回答...

                  How can I convert Persian date to Gregorian date using System.globalization.PersianCalendar? Please note that I want to convert my Persian Date (e.g. today is 1391/04/07) and get the Gregorian Date result which will be 06/27/2012 in this case. I'm counting seconds for an answer ...

                  推荐答案

                  其实很简单:

                  // I'm assuming that 1391 is the year, 4 is the month and 7 is the day
                  DateTime dt = new DateTime(1391, 4, 7, persianCalendar);
                  // Now use DateTime, which is always in the Gregorian calendar
                  

                  当您调用 DateTime 构造函数并传入 Calendar 时,它会为您转换它 - 所以 dt.Year 将是 2012 年这个案例.如果你想走另一条路,你需要构造适当的 DateTime 然后使用 Calendar.GetYear(DateTime) 等.

                  When you call the DateTime constructor and pass in a Calendar, it converts it for you - so dt.Year would be 2012 in this case. If you want to go the other way, you need to construct the appropriate DateTime then use Calendar.GetYear(DateTime) etc.

                  简短而完整的程序:

                  using System;
                  using System.Globalization;
                  
                  class Test
                  {
                      static void Main()
                      {
                          PersianCalendar pc = new PersianCalendar();
                          DateTime dt = new DateTime(1391, 4, 7, pc);
                          Console.WriteLine(dt.ToString(CultureInfo.InvariantCulture));
                      }
                  }
                  

                  打印 06/27/2012 00:00:00.

                  That prints 06/27/2012 00:00:00.

                  这篇关于将日期从波斯语转换为公历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:jqGrid 删除一行 下一篇:如何确定给定日期是否是该月的第 N 个工作日?

                  相关文章

                  最新文章

                    • <bdo id='1F5Dm'></bdo><ul id='1F5Dm'></ul>

                    <i id='1F5Dm'><tr id='1F5Dm'><dt id='1F5Dm'><q id='1F5Dm'><span id='1F5Dm'><b id='1F5Dm'><form id='1F5Dm'><ins id='1F5Dm'></ins><ul id='1F5Dm'></ul><sub id='1F5Dm'></sub></form><legend id='1F5Dm'></legend><bdo id='1F5Dm'><pre id='1F5Dm'><center id='1F5Dm'></center></pre></bdo></b><th id='1F5Dm'></th></span></q></dt></tr></i><div id='1F5Dm'><tfoot id='1F5Dm'></tfoot><dl id='1F5Dm'><fieldset id='1F5Dm'></fieldset></dl></div>
                    <tfoot id='1F5Dm'></tfoot>
                  1. <legend id='1F5Dm'><style id='1F5Dm'><dir id='1F5Dm'><q id='1F5Dm'></q></dir></style></legend>

                    <small id='1F5Dm'></small><noframes id='1F5Dm'>