labs-edaf30/lab4/date.cc
Sven Gestegard Robertz e4df45f4a9 imported lab skeletons
2021-10-27 15:39:22 +02:00

30 lines
543 B
C++

#include <ctime> // time and localtime
#include "date.h"
int Date::daysPerMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
Date::Date() {
time_t timer = time(0); // time in seconds since 1970-01-01
tm* locTime = localtime(&timer); // broken-down time
year = 1900 + locTime->tm_year;
month = 1 + locTime->tm_mon;
day = locTime->tm_mday;
}
Date::Date(int y, int m, int d) {}
int Date::getYear() const {
return 0;
}
int Date::getMonth() const {
return 0;
}
int Date::getDay() const {
return 0;
}
void Date::next() {
}