zoukankan      html  css  js  c++  java
  • 和历与西历之间的转换

    //和历转西历
    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;
            }




  • 相关阅读:
    Ch’s gift HDU
    String HDU
    Rikka with String HDU
    DNA repair HDU
    Ring HDU
    A Secret HDU
    看详细的tomcat报错信息
    linux tomcat服务器优化配置
    linux常用命令
    关于Context []startup failed due to previous errors有效解决方式
  • 原文地址:https://www.cnblogs.com/si812cn/p/935659.html
Copyright © 2011-2022 走看看