]> gitweb.hhaalo.de Git - feierabend.git/commitdiff
change magic number to define
authorBastian Dehn <hhaalo@arcor.de>
Mon, 16 Feb 2026 17:56:23 +0000 (18:56 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 16 Feb 2026 17:56:23 +0000 (18:56 +0100)
src/feierabend.c

index b6b778f8ae201049d04032a11ec7fd1ac295580c..9c7f7b10bdabb502fd0e9910b85b6bbd15e9d80a 100644 (file)
@@ -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);