#define BREAK_TIME "Pausenzeit"
#define WORKTIME_TO "Arbeitszeit bis"
+struct tm _get_tm_from_time(const time_t time)
+{
+ struct tm tm_value;
+ const struct tm* time_tm = localtime(&time);
+ memcpy(&tm_value, time_tm, sizeof(struct tm));
+
+ return tm_value;
+}
+
void _print_german_long_date(const struct tm time_info)
{
char* weekday = get_weekday_str(time_info.tm_wday);
void _print_long_work_end_time(const uint8_t soll_hour,
const uint8_t soll_minutes,
- const struct tm time_tm)
+ const time_t time)
{
+ const struct tm time_tm = _get_tm_from_time(time);
printf("%s %02d:%02d %-9s",
WORK_END,
soll_hour,
timestr = NULL;
}
-struct tm _get_tm_from_time(const time_t time)
-{
- struct tm tm_value;
- const struct tm* time_tm = localtime(&time);
- memcpy(&tm_value, time_tm, sizeof(struct tm));
-
- return tm_value;
-}
-
struct tm _init_tm_with_time(const char* hour, const char* min)
{
struct tm value;
const struct tm begin_tm = _init_tm_with_time(hour, min);
const time_t begin = mktime((struct tm*) &begin_tm);
const time_t worktime_eight_end = get_eight_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 brutto_worktime = get_brutto_worktime(begin, now);
const time_t netto_worktime = get_current_worktime(begin, now);
printf("\n");
_print_long_date_time(WORK_BEGIN, begin_tm);
- _print_long_work_end_time(SOLL_HOUR, SOLL_MINUTES, work_eight_end_tm);
- _print_long_work_end_time(MAX_HOUR, MAX_MINUTES, max_work_end_tm);
+ _print_long_work_end_time(SOLL_HOUR, SOLL_MINUTES, worktime_eight_end);
+ _print_long_work_end_time(MAX_HOUR, MAX_MINUTES, worktime_max_end);
printf("\n");
_print_time(BRUTTO_WORKTIME, brutto_worktime);