+
+ char stringy_date[16];
+ char stringy_time[16];
+ char stringy_gmt[16];
+ struct tm tm;
+ time_t thetime;
+
+ extract_token(stringy_date, cmd, 1, ' ', sizeof stringy_date);
+ extract_token(stringy_time, cmd, 2, ' ', sizeof stringy_time);
+ extract_token(stringy_gmt, cmd, 3, ' ', sizeof stringy_gmt);
+
+ memset(&tm, 0, sizeof tm);
+ if (strlen(stringy_date) == 6) {
+ sscanf(stringy_date, "%2d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
+ tm.tm_year += 100;
+ }
+ else {
+ sscanf(stringy_date, "%4d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
+ tm.tm_year -= 1900;
+ }
+ tm.tm_mon -= 1; // tm_mon is zero based (0=January)
+ tm.tm_isdst = (-1); // let the C library figure out whether DST is in effect
+ sscanf(stringy_time, "%2d%2d%2d", &tm.tm_hour, &tm.tm_min ,&tm.tm_sec);
+ thetime = mktime(&tm);
+ if (!strcasecmp(stringy_gmt, "GMT")) {
+ tzset();
+ thetime += timezone;
+ }
+
+
+ cprintf("231 list of new newsgroups follows\r\n");