VC++开发常用功能一系列文章 (欢迎订阅,持续更新...)
// 阳历转农历
//
// 阳历转农历
//
BOOL CCalendarConvert::GregToLunar(int _gregYear,int _gregMonth,int _gregDay,int& lunarYear,int& lunarMonth,int& lunarDay,BOOL& _bLeap)
{
SYSTEMTIME src = {0};
SYSTEMTIME dst = {0};
COleDateTime dt(_gregYear, _gregMonth, _gregDay,0,0,0);
dt.GetAsSystemTime ( src );
BOOL bEmbolism = TRUE;
if ( Gregorian2Lunar ( &src, &dst, &_bLeap ))
{
COleDateTime dt2(dst);
lunarYear = dt2.GetYear();
lunarMonth = dt2.GetMonth();
lunarDay = dt2.GetDay();
return TRUE;
}
return FALSE;
}
//
// 农历转阳历
//
// 农历转阳历
BOOL CCalendarConvert::Lunar2Gregorian(int _lunarYear, int