summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CTest/cmCTestRunTest.cxx9
-rw-r--r--Source/cmCTest.cxx9
2 files changed, 10 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index adabbc2..13b20de 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -535,15 +535,16 @@ double cmCTestRunTest::ResolveTimeout()
lctime = localtime(&current_time);
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)
{
// 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;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 098bd7a..9ab881c 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2561,15 +2561,16 @@ void cmCTest::DetermineNextDayStop()
lctime = localtime(&current_time);
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)
{
// 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;