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);