Lines 123-133
Link Here
|
123 |
tmd.tm_hour = 0; |
123 |
tmd.tm_hour = 0; |
124 |
tmd.tm_min = 0; |
124 |
tmd.tm_min = 0; |
125 |
tmd.tm_sec = 0; |
125 |
tmd.tm_sec = 0; |
|
|
126 |
tmd.tm_isdst = -1; |
126 |
} |
127 |
} |
127 |
if (otime != NULL) { |
128 |
if (otime != NULL) { |
128 |
tmd.tm_hour = strtol(otime, NULL, 10); |
129 |
tmd.tm_hour = strtol(otime, NULL, 10); |
129 |
tmd.tm_min = strtol(otime + 3, NULL, 10); |
130 |
tmd.tm_min = strtol(otime + 3, NULL, 10); |
130 |
tmd.tm_sec = strtol(otime + 6, NULL, 10); |
131 |
tmd.tm_sec = strtol(otime + 6, NULL, 10); |
|
|
132 |
tmd.tm_isdst = -1; |
131 |
} |
133 |
} |
132 |
tt = mktime(&tmd); |
134 |
tt = mktime(&tmd); |
133 |
} |
135 |
} |
Lines 137-155
Link Here
|
137 |
(GMT.tm_min / 60.0) + (GMT.tm_sec / 3600.0)) / 24.0); |
139 |
(GMT.tm_min / 60.0) + (GMT.tm_sec / 3600.0)) / 24.0); |
138 |
for (cnt = EPOCH; cnt < GMT.tm_year; ++cnt) |
140 |
for (cnt = EPOCH; cnt < GMT.tm_year; ++cnt) |
139 |
days += isleap(1900 + cnt) ? 366 : 365; |
141 |
days += isleap(1900 + cnt) ? 366 : 365; |
140 |
today = potm(days) + .5; |
142 |
today = potm(days); |
141 |
if (pflag) { |
143 |
if (pflag) { |
142 |
(void)printf("%1.0f\n", today); |
144 |
(void)printf("%1.0f\n", today); |
143 |
return (0); |
145 |
return (0); |
144 |
} |
146 |
} |
145 |
(void)printf("The Moon is "); |
147 |
(void)printf("The Moon is "); |
146 |
if ((int)today == 100) |
148 |
if (today >= 99.5) |
147 |
(void)printf("Full\n"); |
149 |
(void)printf("Full\n"); |
148 |
else if (!(int)today) |
150 |
else if (today < 0.5) |
149 |
(void)printf("New\n"); |
151 |
(void)printf("New\n"); |
150 |
else { |
152 |
else { |
151 |
tomorrow = potm(days + 1); |
153 |
tomorrow = potm(days + 1); |
152 |
if ((int)today == 50) |
154 |
if (today >= 49.5 && today < 50.5) |
153 |
(void)printf("%s\n", tomorrow > today ? |
155 |
(void)printf("%s\n", tomorrow > today ? |
154 |
"at the First Quarter" : "at the Last Quarter"); |
156 |
"at the First Quarter" : "at the Last Quarter"); |
155 |
else { |
157 |
else { |