From: Bastian Dehn Date: Mon, 16 Feb 2026 17:56:23 +0000 (+0100) Subject: change magic number to define X-Git-Tag: 1.3.15^2~5 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=f104c9c776a1c6f77282e040e795ebc7d400536f;p=feierabend.git change magic number to define --- diff --git a/src/feierabend.c b/src/feierabend.c index b6b778f..9c7f7b1 100644 --- a/src/feierabend.c +++ b/src/feierabend.c @@ -6,6 +6,9 @@ #include "validate.h" #include "time_format.h" +#define MONTH_CORRECTION 1 +#define EPOCH_ZERO 1900 + void _print_german_long_date(const struct tm time_info) { char* weekday = get_weekday_str(time_info.tm_wday); @@ -13,8 +16,8 @@ void _print_german_long_date(const struct tm time_info) printf("%s %02d.%02d.%04d %02d:%02d", weekday, time_info.tm_mday, - time_info.tm_mon + 1, - time_info.tm_year + 1900, + time_info.tm_mon + MONTH_CORRECTION, + time_info.tm_year + EPOCH_ZERO, time_info.tm_hour, time_info.tm_min);