-
Notifications
You must be signed in to change notification settings - Fork 4
/
Time.h
46 lines (38 loc) · 924 Bytes
/
Time.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
/*
* File: CTime.h
* Author: Administrator
*
* Created on 2014年1月26日, 下午4:49
*/
#ifndef TIME_H
#define TIME_H
#include "TimeSpan.h"
namespace CommLib {
class Time {
public:
Time(time_t tt);
Time();
Time(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec);
Time(const Time& orig);
virtual ~Time();
int GetDay();
int GetDayOfWeek();
int GetHour();
int GetMinute();
int GetMonth();
int GetSecond();
time_t GetTime();
int GetYear();
static Time GetCurrentTime();
static long GetCurrTick();
Time operator +(TimeSpan &span);
Time operator +(time_t tt);
Time operator -(time_t tt);
Time operator -(TimeSpan &span);
TimeSpan operator -(Time &tm);
private:
tm tm_;
time_t tt_;
};
}
#endif /* CTIME_H */