summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-03-23 20:33:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-03-23 20:33:47 (GMT)
commit239ee9c26c933b3eed197af40290c3416fce8dcc (patch)
tree5c552014c7c28dd97d6c5f216c2af666bcaa96b1 /Source/cmCTest.cxx
parent5cd2892f017ead48c61f43cb01d0a765a95e24c8 (diff)
downloadCMake-239ee9c26c933b3eed197af40290c3416fce8dcc.zip
CMake-239ee9c26c933b3eed197af40290c3416fce8dcc.tar.gz
CMake-239ee9c26c933b3eed197af40290c3416fce8dcc.tar.bz2
BUG: fix problem with new curl_getdate and ctest
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index eb896a9..57eee39 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -61,6 +61,12 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
{
struct tm* lctime;
time_t tctime = time(0);
+ lctime = gmtime(&tctime);
+ char buf[1024];
+ // add todays year day and month to the time in str because
+ // curl_getdate no longer assumes the day is today
+ sprintf(buf, "%d%02d%02d %s", lctime->tm_year+1900, lctime->tm_mday,
+ lctime->tm_mon, str.c_str());
cmCTestLog(this, OUTPUT, "Determine Nightly Start Time" << std::endl
<< " Specified time: " << str.c_str() << std::endl);
//Convert the nightly start time to seconds. Since we are
@@ -69,7 +75,7 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
//is the time at which the nightly dashboard was opened or
//will be opened on the date of the current client machine.
//As such, this time may be in the past or in the future.
- time_t ntime = curl_getdate(str.c_str(), &tctime);
+ time_t ntime = curl_getdate(buf, &tctime);
cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl);
tctime = time(0);
cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl);