-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDate.h
More file actions
38 lines (34 loc) · 868 Bytes
/
Date.h
File metadata and controls
38 lines (34 loc) · 868 Bytes
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
34
35
36
37
38
#ifndef DATE_H
#define DATE_H
#include <string>
class Date {
public:
Date();
Date(int y, int m, int d, int h, int mi);
int getYear(void) const;
void setYear(int year);
int getMonth(void) const;
void setMonth(int month);
int getDay(void) const;
void setDay(int day);
int getHour(void) const;
void setHour(int hour);
int getMinute(void) const;
void setMinute(int minute);
static bool isValid(Date date);
static Date stringToDate(std::string dateString);
static std::string dateToString(Date date);
Date &operator=(const Date& date);
bool operator==(const Date& date) const;
bool operator>(const Date& date) const;
bool operator<(const Date& date) const;
bool operator>=(const Date& date) const;
bool operator<=(const Date& date) const;
private:
int year_;
int month_;
int day_;
int hour_;
int minute_;
};
#endif