![]() ![]() | ![]() |
version 1.261, 2020/08/27 06:55:54 | version 1.262, 2020/09/16 18:37:55 | ||
---|---|---|---|
|
|
||
struct tm now_tm, tm; | struct tm now_tm, tm; | ||
time_t now, age; | time_t now, age; | ||
char s[6]; | char s[6]; | ||
int m; | |||
time(&now); | time(&now); | ||
if (now < t) | if (now < t) | ||
|
|
||
} | } | ||
/* Last 12 months. */ | /* Last 12 months. */ | ||
if (now_tm.tm_mon == 0) | |||
m = 11; | |||
else | |||
m = now_tm.tm_mon - 1; | |||
if ((tm.tm_year == now_tm.tm_year && tm.tm_mon < now_tm.tm_mon) || | if ((tm.tm_year == now_tm.tm_year && tm.tm_mon < now_tm.tm_mon) || | ||
(tm.tm_year == now_tm.tm_year - 1 && tm.tm_mon > now_tm.tm_mon)) { | (tm.tm_year == now_tm.tm_year - 1 && tm.tm_mon > now_tm.tm_mon)) { | ||
strftime(s, sizeof s, "%d%b", &tm); | strftime(s, sizeof s, "%d%b", &tm); |