Fix StopTime to also account for localtime being a day ahead of gmtime
This commit is contained in:
parent
9676c52c3e
commit
9eea95c90f
|
@ -535,15 +535,16 @@ double cmCTestRunTest::ResolveTimeout()
|
||||||
lctime = localtime(¤t_time);
|
lctime = localtime(¤t_time);
|
||||||
int local_hour = lctime->tm_hour;
|
int local_hour = lctime->tm_hour;
|
||||||
|
|
||||||
int tzone_offset = 0;
|
int tzone_offset = local_hour - gm_hour;
|
||||||
if(gm_time > current_time && gm_hour < local_hour)
|
if(gm_time > current_time && gm_hour < local_hour)
|
||||||
{
|
{
|
||||||
// this means gm_time is on the next day
|
// this means gm_time is on the next day
|
||||||
tzone_offset = local_hour - gm_hour - 24;
|
tzone_offset -= 24;
|
||||||
}
|
}
|
||||||
else
|
else if(gm_time < current_time && gm_hour > local_hour)
|
||||||
{
|
{
|
||||||
tzone_offset = local_hour - gm_hour;
|
// this means gm_time is on the previous day
|
||||||
|
tzone_offset += 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
tzone_offset *= 100;
|
tzone_offset *= 100;
|
||||||
|
|
|
@ -2561,15 +2561,16 @@ void cmCTest::DetermineNextDayStop()
|
||||||
lctime = localtime(¤t_time);
|
lctime = localtime(¤t_time);
|
||||||
int local_hour = lctime->tm_hour;
|
int local_hour = lctime->tm_hour;
|
||||||
|
|
||||||
int tzone_offset = 0;
|
int tzone_offset = local_hour - gm_hour;
|
||||||
if(gm_time > current_time && gm_hour < local_hour)
|
if(gm_time > current_time && gm_hour < local_hour)
|
||||||
{
|
{
|
||||||
// this means gm_time is on the next day
|
// this means gm_time is on the next day
|
||||||
tzone_offset = local_hour - gm_hour - 24;
|
tzone_offset -= 24;
|
||||||
}
|
}
|
||||||
else
|
else if(gm_time < current_time && gm_hour > local_hour)
|
||||||
{
|
{
|
||||||
tzone_offset = local_hour - gm_hour;
|
// this means gm_time is on the previous day
|
||||||
|
tzone_offset += 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
tzone_offset *= 100;
|
tzone_offset *= 100;
|
||||||
|
|
Loading…
Reference in New Issue