VC++农历与公历转换
作者:互联网
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
标签:公历,src,int,C++,农历,BOOL,dt2,阳历 来源: https://blog.csdn.net/kaizi318/article/details/113584582