-
Notifications
You must be signed in to change notification settings - Fork 0
/
date.h
52 lines (40 loc) · 978 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
49
50
51
52
#ifndef DATE_H
#define DATE_H
#include <iostream>
#define DATE_STRBUFF 100
#define DATE_FORMAT "%A, %d %B %Y - %X"
extern const unsigned int day_secs;
using namespace std;
class Date {
struct tm timeInfo;
static unsigned int sec_add;
char buffer[DATE_STRBUFF];
public:
Date();
Date(int);
/*Set current time*/
void set();
/*Set current time plus seconds*/
void set(unsigned int);
/*Set specific time from argument*/
void set(const time_t&);
void set_sec(const int);
void set_min(const int);
void set_hour(const int);
void set_day(const int);
void set_mon(const int);
void set_weekDay(const int);
void set_yearDay(const int);
void set_daylightSavingTime(const int);
int get_sec() const;
int get_min() const;
int get_hour() const;
int get_day() const;
int get_mon() const;
int get_weekDay() const;
int get_yearDay() const;
int get_daylightSavingTime() const;
const string get_str(const char * _format = DATE_FORMAT);
void print();
};
#endif