公曆轉農曆函數
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詳解(二)