Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DateTime / DateTime.h
blob: f8753ced3cb07ba67ee90ed1597808c5de08b853 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef HEADER_DATETIME
#define HEADER_DATETIME

class DateTime {
	unsigned short hour;
	unsigned short minute;
	unsigned short day;
	unsigned short month;
	unsigned short year;

	bool isLeapYear();

public:
	DateTime(unsigned short hour, unsigned short minute, unsigned short day, unsigned short month, unsigned short year);
	int compare(const DateTime& other);

	unsigned short get_hour();
	bool set_hour(unsigned short newHour);

	unsigned short get_minute();
	bool set_minute(unsigned short newMinute);

	unsigned short get_day();
	bool set_day(unsigned short newDay);

	unsigned short get_month();
	bool set_month(unsigned short newMonth);

	unsigned short get_year();
	bool set_year(unsigned short newYear);
};

#endif