示例#1
0
文件: 1.c 项目: bcho/homework
int main()
{
    printf("%d\n", previous_day(Monday));
    printf("%d\n", next_day(Sunday));
    printf("%d %d", increment_day(Thursday, 4), increment_day(Monday, -4));

    return 0;
}
示例#2
0
TimeWithDate& TimeWithDate::operator-= (time_t t)
{
	t -= this->seconds();
	int d = 0;
	while(t < 0)
	{
		d++;
		t += SECS_IN_A_DAY;
	}
	for (int i = 0; i < d; ++i)
		previous_day();
	return *this = TimeWithDate(year, month, day, t);
}