/*
- * Extended `who' command, version 1.11.
+ * Extended `who' command, version 1.12.
*
- * (c) 1996--2003 Martin Mares <mj@ucw.cz>
+ * (c) 1996--2010 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU General Public License. See file COPYING in any of the GNU packages.
}
{
- struct tm *tm;
- char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
now = time(NULL);
- tm = localtime(&now);
- printf(" on %s %02d-%02d-%02d %02d.%02d:%02d", days[tm->tm_wday], tm->tm_mday, tm->tm_mon+1,
- tm->tm_year%100, tm->tm_hour, tm->tm_min, tm->tm_sec);
- printf(" (%u UE)\n", (unsigned int) now);
+ struct tm *tm = localtime(&now);
+ strftime(line, sizeof(line), "%a %Y-%m-%d %H.%M:%S", tm);
+ printf(" on %s\n", line);
}
}
printf(" of swap");
}
}
- printf(", %d user%s.\n", usercnt, usercnt == 1 ? "" : "s");
+ printf(", %d user%s\n", usercnt, usercnt == 1 ? "" : "s");
}
static void