]> gitweb.hhaalo.de Git - feierabend.git/commitdiff
add soll work time
authorBastian Dehn <hhaalo@arcor.de>
Sun, 9 Jun 2024 16:03:21 +0000 (18:03 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 9 Jun 2024 16:03:21 +0000 (18:03 +0200)
src/main.c

index 644e8bf31c4aa2eeee402cd5107464833e2e5297..1ad431880cb94081b4e78377125f07d009e1091a 100644 (file)
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <time.h>
 #include "time_format.h"
+#include "worktime.h"
 
 int main(int argc, char* argv[])
 {
@@ -16,6 +17,7 @@ int main(int argc, char* argv[])
        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;
@@ -32,5 +34,10 @@ int main(int argc, char* argv[])
                now_tm.tm_hour,
                now_tm.tm_min);
 
+       time_t work_end_eight_hours = get_eight_hour_end_worktime(begin);
+       char timestr[6];
+       get_time_str(work_end_eight_hours, timestr);
+       printf("Sollarbeitzeit bis: %s\n", timestr);
+
        return 0;
 }
\ No newline at end of file