CBlueUI  
C++ 跨平台跨框架的数据可视化工具
载入中...
搜索中...
未找到
DateInfo类 参考

日期类,包含中国农历历法1900到2099年 更多...

Public 成员函数

 DateInfo (int year=1901, int month=1, int day=1)
 DateInfo (const DateInfo &d)
BOOL IsLeapYear () const
 判断闰年
void CorrectTheDate ()
 纠正日期
void Zero ()
 重置为空
BOOL IsZero () const
 是否有效
int DayOfTheWeek () const
 获得周几
DateInfo operator+ (int day)
 日期加天数
DateInfo operator- (int day)
 日期减天数
bool operator== (const DateInfo &d) const
bool operator!= (const DateInfo &d) const
bool operator<= (const DateInfo &d) const
bool operator>= (const DateInfo &d) const
bool operator< (const DateInfo &d) const
bool operator> (const DateInfo &d) const
DateInfooperator= (const DateInfo &d)
BOOL PrintfLunarDate (char *buffer, int buffer_size, const DateInfo *date_today=NULL) const
 将农历日期打印到指定缓存区
void PrintfLunarYear (char *buffer, int buffer_size) const
 将农历生肖年份打印到指定缓存区
int MonthDayCounts () const
 计算当年月的天数

静态 Public 成员函数

static int WeekFirstDay (int year, int month)
 计算当前月的第一天是星期几
static DateInfo Today ()

Public 属性

int m_year
int m_month
int m_day_of_month

详细描述

日期类,包含中国农历历法1900到2099年

构造及析构函数说明

◆ DateInfo() [1/2]

DateInfo::DateInfo ( int year = 1901,
int month = 1,
int day = 1 )

◆ DateInfo() [2/2]

DateInfo::DateInfo ( const DateInfo & d)

成员函数说明

◆ CorrectTheDate()

void DateInfo::CorrectTheDate ( )

纠正日期

◆ DayOfTheWeek()

int DateInfo::DayOfTheWeek ( ) const

获得周几

◆ IsLeapYear()

BOOL DateInfo::IsLeapYear ( ) const

判断闰年

返回
BOOL:若返回TRUE,表示符合闰年条件。若返回FALSE,则不符合闰年条件。

◆ IsZero()

BOOL DateInfo::IsZero ( ) const

是否有效

◆ MonthDayCounts()

int DateInfo::MonthDayCounts ( ) const

计算当年月的天数

◆ operator!=()

bool DateInfo::operator!= ( const DateInfo & d) const

◆ operator+()

DateInfo DateInfo::operator+ ( int day)

日期加天数

◆ operator-()

DateInfo DateInfo::operator- ( int day)

日期减天数

◆ operator<()

bool DateInfo::operator< ( const DateInfo & d) const

◆ operator<=()

bool DateInfo::operator<= ( const DateInfo & d) const

◆ operator=()

DateInfo & DateInfo::operator= ( const DateInfo & d)

◆ operator==()

bool DateInfo::operator== ( const DateInfo & d) const

◆ operator>()

bool DateInfo::operator> ( const DateInfo & d) const

◆ operator>=()

bool DateInfo::operator>= ( const DateInfo & d) const

◆ PrintfLunarDate()

BOOL DateInfo::PrintfLunarDate ( char * buffer,
int buffer_size,
const DateInfo * date_today = NULL ) const

将农历日期打印到指定缓存区

参数
buffer: 目标输出缓冲区。
buffer_size: 缓冲区字节总数
date_today: 日期

◆ PrintfLunarYear()

void DateInfo::PrintfLunarYear ( char * buffer,
int buffer_size ) const

将农历生肖年份打印到指定缓存区

参数
buffer: 目标输出缓冲区。
buffer_size: 缓冲区字节总数

◆ Today()

DateInfo DateInfo::Today ( )
static

◆ WeekFirstDay()

int DateInfo::WeekFirstDay ( int year,
int month )
static

计算当前月的第一天是星期几

◆ Zero()

void DateInfo::Zero ( )

重置为空

类成员变量说明

◆ m_day_of_month

int DateInfo::m_day_of_month

◆ m_month

int DateInfo::m_month

◆ m_year

int DateInfo::m_year
鄂公网安备42018502007752 鄂ICP备2024082886
Copyright © 2026 · CBlueStudio 版权所有