From: Bastian Dehn Date: Sat, 14 Feb 2026 13:20:57 +0000 (+0100) Subject: change order to calc X-Git-Tag: 1.3.12^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=a3b6f15d6a73432bb46f33ab5f13c515597927e5;p=feierabend.git change order to calc --- diff --git a/src/feierabend.c b/src/feierabend.c index 90da2e0..6a3f1c3 100644 --- a/src/feierabend.c +++ b/src/feierabend.c @@ -140,22 +140,22 @@ int main(int argc, const char* argv[]) printf("Version: %s\n\n", PROJECT_VERSION); + const struct tm now_tm = _init_tm_with_time(NULL, NULL); + const time_t now = mktime((struct tm*) &now_tm); const struct tm begin_tm = _init_tm_with_time(argv[1], argv[2]); - const struct tm end_tm = _init_tm_with_time(NULL, NULL); const time_t begin = mktime((struct tm*) &begin_tm); - const time_t end = mktime((struct tm*) &end_tm); const time_t worktime_eight_end = get_eight_hour_end_worktime(begin); - const time_t worktime_max_end = get_ten_hour_end_worktime(begin); const struct tm work_eight_end_tm = _get_tm_from_time(worktime_eight_end); + const time_t worktime_max_end = get_ten_hour_end_worktime(begin); const struct tm max_work_end_tm = _get_tm_from_time(worktime_max_end); - const time_t netto_worktime = get_current_worktime(begin, end); - const time_t brutto_worktime = get_brutto_worktime(begin, end); + const time_t brutto_worktime = get_brutto_worktime(begin, now); + const time_t netto_worktime = get_current_worktime(begin, now); const time_t break_time = get_break_time(brutto_worktime); - const time_t diff_to_end = get_current_worktime_diff_to_end_eight_hour(begin, end); - const time_t diff_to_max_end = get_current_worktime_diff_to_end_ten_hour(begin, end); + const time_t diff_to_end = get_current_worktime_diff_to_end_eight_hour(begin, now); + const time_t diff_to_max_end = get_current_worktime_diff_to_end_ten_hour(begin, now); - _print_time_now(end_tm); + _print_time_now(now_tm); printf("\n"); _print_work_begin(begin_tm);