コード例 #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.cpp プロジェクト: hsinhuang/codebase
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);
}