Explorar o código

Update htime.h

闰年判断宏逻辑修复
yuanfeng1897 %!s(int64=4) %!d(string=hai) anos
pai
achega
16f5f401d2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      base/htime.h

+ 1 - 1
base/htime.h

@@ -10,7 +10,7 @@ BEGIN_EXTERN_C
 #define SECONDS_PER_DAY     86400   // 24*3600
 #define SECONDS_PER_WEEK    604800  // 7*24*3600
 
-#define IS_LEAP_YEAR(year) (((year)%4 == 0 && (year)%100 != 0) || (year)%100 == 0)
+#define IS_LEAP_YEAR(year) (((year)%4 == 0 && (year)%100 != 0) || (year)%400 == 0)
 
 typedef struct datetime_s {
     int year;