time_t begin = 0;
struct tm begin_tm;
+ time_t now = 0;
+ struct tm now_tm;
+ char weekday[11];
+ time_t work_end = 0;
+ char timestr[6];
+
time(&begin);
gmtime_r(&begin, &begin_tm);
begin_tm.tm_hour = atoi(argv[1]);
begin_tm.tm_min = atoi(argv[2]);
begin = mktime(&begin_tm);
- time_t now = 0;
- struct tm now_tm;
time(&now);
localtime_r(&now, &now_tm);
- char weekday[11];
get_weekday(now_tm.tm_wday, weekday);
-
printf("Aktuelle Zeit: %s %02d.%02d.%04d %02d:%02d\n",
weekday,
now_tm.tm_mday,
now_tm.tm_hour,
now_tm.tm_min);
- time_t work_end = get_eight_hour_end_worktime(begin);
- char timestr[6];
+ get_time_str(begin, timestr);
+ printf("Arbeitszeitbeginn: %s\n", timestr);
+
+ work_end = get_eight_hour_end_worktime(begin);
get_time_str(work_end, timestr);
printf("Sollarbeitzeit bis 8 Std: %s\n", timestr);