add GetDateTimeSeconds
This commit is contained in:
parent
71253c2b72
commit
ab8a6b21f1
@ -185,6 +185,14 @@ namespace a8
|
|||||||
return (time_val1 + g_time_zone*3600)/3600/24 - (time_val2 + g_time_zone*3600)/3600/24;
|
return (time_val1 + g_time_zone*3600)/3600/24 - (time_val2 + g_time_zone*3600)/3600/24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_t GetDateTimeSeconds(const char* datetime_str)
|
||||||
|
{
|
||||||
|
struct tm stm;
|
||||||
|
strptime(datetime_str, "%Y-%m-%d %H:%M:%S", &stm);
|
||||||
|
long t = mktime(&stm);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
long long MakeInt64(int low32, int high32)
|
long long MakeInt64(int low32, int high32)
|
||||||
{
|
{
|
||||||
return low32 + ((long long)high32 << 32);
|
return low32 + ((long long)high32 << 32);
|
||||||
|
@ -67,6 +67,7 @@ namespace a8
|
|||||||
std::string FormatDateTime(time_t time_val);
|
std::string FormatDateTime(time_t time_val);
|
||||||
time_t GetDaySeconds(time_t time_val, int incdays = 0);
|
time_t GetDaySeconds(time_t time_val, int incdays = 0);
|
||||||
time_t BetweenDays(time_t time_val1, time_t time_val2);
|
time_t BetweenDays(time_t time_val1, time_t time_val2);
|
||||||
|
time_t GetDateTimeSeconds(const char* datetime_str);
|
||||||
|
|
||||||
long long MakeInt64(int low32, int high32);
|
long long MakeInt64(int low32, int high32);
|
||||||
int Low32(long long int64_val);
|
int Low32(long long int64_val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user