公历转农历函数
class Program { static void Main(string[] args) { System.Globalization.ChineseLunisolarCalendar chineseLunisolarCalendar = new System.Globalization.ChineseLunisolarCalendar(); DateTime date = DateTime.Now; int year = chineseLunisolarCalendar.GetYear(date); int month = chineseLunisolarCalendar.GetMonth(date); int day = chineseLunisolarCalendar.GetDayOfMonth(date); Console.WriteLine(string.Format("公历:{0} 农历:{1}", date.ToString("yyyy-MM-dd"), (year + "-" + month + "-" + day))); Console.Read(); } }
最后更新:2017-04-02 06:52:21
上一篇:
JAVASCRIPT学习笔记基础(四)
下一篇:
Android 近百个项目的源代码,覆盖Android开发的每个领域
友元类
通过心理学知识提高问题定位与解决能力(上)
MySQL · 捉虫动态 · show binary logs 灵异事件
Sql Server中如何取得刚刚插入的自增长的id值
MaxCompute-GRAPH可配置参数列表(持续更新)
Android 5.0发布日期/机型/功能传言汇总
[jBPM系列]jBPM的流程设计器(GPD)在Eclipse里的安装
spring使用中报Cannot proxy target class because CGLIB2 is not available错
HTAP数据库 PostgreSQL 场景与性能测试之 6 - (OLTP) 空间应用 - KNN查询(搜索附近对象,由近到远排序输出)
actionbar详解(二)