瀏覽代碼

CPackIFW: Replace use of strftime with cmTimestamp

The latter is more portable.
Brad King 11 年之前
父節點
當前提交
73b336c9f1
共有 1 個文件被更改,包括 3 次插入10 次删除
  1. 3 10
      Source/CPack/cmCPackIFWGenerator.cxx

+ 3 - 10
Source/CPack/cmCPackIFWGenerator.cxx

@@ -19,6 +19,7 @@
 #include "cmGeneratedFileStream.h"
 #include "cmCPackLog.h"
 #include "cmCPackComponentGroup.h"
+#include "cmTimestamp.h"
 
 #include <cmsys/SystemTools.hxx>
 #include <cmsys/Glob.hxx>
@@ -809,16 +810,8 @@ int cmCPackIFWGenerator::IfwCreatePackageFile()
 //----------------------------------------------------------------------
 std::string cmCPackIFWGenerator::IfwCreateCurrentDate()
 {
-  time_t rawtime;
-  struct tm * timeinfo;
-  char buffer[80];
-
-  time (&rawtime);
-  timeinfo = localtime(&rawtime);
-
-  strftime(buffer, 80, "%Y-%m-%d", timeinfo);
-
-  return buffer;
+  cmTimestamp timestamp;
+  return timestamp.CurrentTime("%Y-%m-%d", false);
 }
 
 //----------------------------------------------------------------------