diff --git a/a8/sysutils.cc b/a8/sysutils.cc index 9f8cf19..35feec3 100644 --- a/a8/sysutils.cc +++ b/a8/sysutils.cc @@ -179,6 +179,12 @@ namespace a8 return time_t((time_val + g_time_zone * 3600)/3600/24 + incdays) * 3600 * 24 - 3600 * g_time_zone; } + time_t BetweenDays(time_t time_val1, time_t time_val2) + { + int g_time_zone = 8; + return (time_val1 + g_time_zone*3600)/3600/24 - (time_val2 + g_time_zone*3600)/3600/24; + } + long long MakeInt64(int low32, int high32) { return low32 + ((long long)high32 << 32); diff --git a/a8/sysutils.h b/a8/sysutils.h index 834628f..52fabc6 100644 --- a/a8/sysutils.h +++ b/a8/sysutils.h @@ -66,6 +66,7 @@ namespace a8 std::string FormatDateTime(time_t time_val); time_t GetDaySeconds(time_t time_val, int incdays = 0); + time_t BetweenDays(time_t time_val1, time_t time_val2); long long MakeInt64(int low32, int high32); int Low32(long long int64_val);