//和历转西历
private string DateTimeTransform(string pDate, string pFormat)
        {
            CultureInfo vCurrentInfo = new CultureInfo("ja-JP", true);
            vCurrentInfo.DateTimeFormat.Calendar = new JapaneseCalendar();
            DateTime vCurrentDate = Convert.ToDateTime(pDate, vCurrentInfo.DateTimeFormat);

            string vReturnDate = vCurrentDate.ToString(pFormat, DateTimeFormatInfo.InvariantInfo);

            return vReturnDate;
        }
//西历转和历
private string DateTimeTransform(string pDate, string pFormat)
        {
            CultureInfo vCurrentInfo = new CultureInfo("ja-JP", true);
            vCurrentInfo.DateTimeFormat.Calendar = new JapaneseCalendar();
            DateTime vCurrentDate = Convert.ToDateTime(pDate);

            string vReturnDate = vCurrentDate.ToString(pFormat, vCurrentInfo.DateTimeFormat);

            return vReturnDate;
        }




相关文章:

  • 2022-02-08
  • 2022-01-21
  • 2022-12-23
  • 2022-01-23
  • 2022-02-27
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-09-11
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案