8 |
|
#define _TimeZones_hpp_ |
9 |
|
|
10 |
|
#include <iostream> |
11 |
+ |
#include <fstream> |
12 |
|
#include <string> |
13 |
+ |
#include <list> |
14 |
|
#include <cstdlib> |
15 |
|
#include <cstdio> |
16 |
|
#include <ctime> |
39 |
|
|
40 |
|
inline void sunsetenv(const string& name) { unsetenv(name.c_str()); } |
41 |
|
|
40 |
– |
#ifdef __CYGWIN__ |
41 |
– |
|
42 |
– |
inline time_t timegm(struct tm* time) |
43 |
– |
{ |
44 |
– |
string zone = sgetenv("TZ"); |
45 |
– |
|
46 |
– |
sputenv("TZ="); |
47 |
– |
tzset(); |
48 |
– |
|
49 |
– |
time_t when = mktime(time); |
50 |
– |
|
51 |
– |
sputenv("TZ=" + zone); |
52 |
– |
tzset(); |
53 |
– |
|
54 |
– |
return when; |
55 |
– |
} |
56 |
– |
|
57 |
– |
#endif |
58 |
– |
|
42 |
|
class TimeZones |
43 |
|
{ |
44 |
|
private: |
45 |
< |
// |
45 |
> |
time_t now; |
46 |
> |
void display(); |
47 |
> |
void display(const string& location, const string& zone); |
48 |
|
public: |
49 |
|
TimeZones(); |
50 |
|
~TimeZones() {} |