聽到有人討論,才發現Outlook今年(2013)的農曆日期有誤:

6/12明明是五月初五端午節,Outlook的顯示卻是五月初四。

研究後發現,這是Outlook與官方採用的萬年曆版本不一致造成。我國現行農曆曆書採用南京紫金山天文台萬年曆,今年農曆四月是小月為29天,故6/8應是五月初一而非Outlook所顯示的四月三十;而清朝制訂的萬年曆曆書則主張今年農曆四月是大月30天,因而產生了一天的差異。(參考: 今年端午節到底是哪天?)

查了一下,Outlook的各版本都有此問題,而Outlook 2013已有Hotfix可修正,其他版本的修正則暫無所獲,提醒大家在參考應用時要留意。

  • When you use the Chinese lunar calendar in Outlook 2013 or in an earlier version of Outlook, the Gregorian date is displayed as an incorrect lunar date. For example, the Gregorian date June 8, 2013 is displayed as lunar date 4/30 instead of 5/1.

趕緊檢查一下.NET的農曆計算,還好還好,日期正確,Pass!!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace TestTwCalender
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Globalization.TaiwanLunisolarCalendar tlc =
                new System.Globalization.TaiwanLunisolarCalendar();
            DateTime d = new DateTime(2013, 6, 12);
            Console.Write("{0:yyyy/MM/dd}是農曆{1}月{2}日",
                d, tlc.GetMonth(d), tlc.GetDayOfMonth(d));
            Console.Read();
        }
    }
}
2013/06/12是農曆5月5日

【延伸閱讀】


Comments

Be the first to post a comment

Post a comment