Show day of the week stats

sql-rework
Tomasz Golinski 2019-11-17 19:42:32 +01:00
rodzic ad98624734
commit e20dbd2f48
3 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -26,12 +26,15 @@ void Cache::set_date(std::tm* t) {
char tmp[20];
date_tm = *t;
std::mktime(&date_tm);
year = std::to_string(1900+date_tm.tm_year);
std::strftime(tmp, 20, "(%m) %B", &date_tm);
mon = tmp;
day = std::to_string(date_tm.tm_mday);
hour = std::to_string(date_tm.tm_hour);
std::strftime(tmp, 20, "(%u) %A", &date_tm);
day_of_week = tmp;
std::strftime(tmp, 20, "%F", &date_tm);
date = tmp;

Wyświetl plik

@ -59,6 +59,7 @@ public:
std::string mon;
std::string day;
std::string hour;
std::string day_of_week;
std::string date;
void set_date(std::tm* t);

Wyświetl plik

@ -351,6 +351,7 @@ int main(int argc, char** argv) {
}
if ((show_calendar || show_html) && !get_not_found) {
show_histogram(&cc, &Cache::day_of_week, "Days of the week", show_html, 0);
show_histogram(&cc, &Cache::mon, "Months", show_html, 0);
show_histogram(&cc, &Cache::year, "Years", show_html, 0);
}