随笔-20  评论-32  文章-9  trackbacks-1
//和历转西历
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;
        }

posted on 2008-07-24 16:55 冷风旋 阅读(54) 评论(0)  编辑 收藏 网摘

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
Google站内搜索

相关文章:

相关链接: