-
Notifications
You must be signed in to change notification settings - Fork 0
/
Date.h
48 lines (34 loc) · 848 Bytes
/
Date.h
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
39
40
41
42
43
44
45
46
47
48
#ifndef DATE_H_
#define DATE_H_
#include <iostream>
#include <ctime>
#include <string.h>
#include <cstring>
class Date{
private:
int day;
int month;
int year;
public:
/* Constructor */
Date(int d = 1, int m = 1, int y = 2000);
/* Setters */
void setDay(int d);
void setMonth(int m);
void setYear(int y);
/* Accessors */
int getDay() const;
int getMonth() const;
int getYear() const;
/* Compare 2 dates to see whitch is older */
int compareDates(Date date2);
/* Get today's date e.g. 27-12-2020 */
int getTodaysDate();
/* Print date e.g. 27-12-2020 */
void printDate();
/* Get date from string e.g. 27-12-2020 */
int getDateFromStr(std::string str);
bool lessThan6Months(Date travelDate);
std::string convertDateToStr();
};
#endif