9 |
|
void Host::setSince(const string& since) |
10 |
|
{ |
11 |
|
struct tm when; |
12 |
< |
|
12 |
> |
|
13 |
> |
memset(&when, 0, sizeof(struct tm)); |
14 |
> |
|
15 |
> |
#ifndef __CYGWIN__ |
16 |
|
strptime(since.c_str(), "%m/%d/%Y %H:%M:%S %Z", &when); |
17 |
+ |
#else |
18 |
+ |
strptime(since.c_str(), "%m/%d/%Y %H:%M:%S", &when); |
19 |
+ |
#endif |
20 |
|
|
21 |
< |
time_t time = mktime(&when); |
16 |
< |
|
17 |
< |
localtime_r(&time, &when); |
21 |
> |
time_t time = timegm(&when); |
22 |
|
|
23 |
< |
char then[45]; |
23 |
> |
memcpy(&when, localtime(&time), sizeof(struct tm)); |
24 |
|
|
25 |
< |
strftime(then, 45, "%A %B %e, %Y %l:%M:%S %p %Z", &when); |
25 |
> |
char then[61]; |
26 |
> |
|
27 |
> |
strftime(then, 61, "%A, %B %e, %Y %l:%M:%S %p %Z", &when); |
28 |
|
|
29 |
|
this->since = then; |
30 |
|
} |
47 |
|
istream& operator>>(istream& input, Host& host) |
48 |
|
{ |
49 |
|
bool done = false; |
50 |
< |
|
50 |
> |
|
51 |
|
do |
52 |
|
{ |
53 |
|
switch (input.peek()) |