From ac428377e6243eafe3bf7178a73c19ce3ab6fac2 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 1 Sep 2014 10:07:43 +0000 Subject: [PATCH] fhem.pl/fhemTimeGm fix by Boris (Forum #26679) git-svn-id: https://svn.fhem.de/fhem/trunk@6495 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index c87bb1813..7e440ff14 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -3672,8 +3672,7 @@ fhemTimeGm($$$$$$) { $year+= 1900; my $isleapyear= $year % 4 ? 0 : $year % 100 ? 1 : $year % 400 ? 0 : 1; - # here the Wikipedia as at 2012-12-01 is wrong and that code line is right - my $leapyears= int(($year-1968)/4 - ($year-1900)/100 + ($year-1600)/400); + my $leapyears= int(($year-1969)/4) - int(($year-1901)/100) + int(($year-1601)/400); #Debug sprintf("%02d.%02d.%04d %02d:%02d:%02d %d leap years, is leap year: %d", $mday,$month+1,$year,$hour,$min,$sec,$leapyears,$isleapyear); if ( $^O eq 'MacOS' ) {