diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 6fd6ab7..a65b4d9 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -67,66 +67,73 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT,
     {
     ptr = localtime(&timeT);
     }
 
   if(ptr == 0)
     {
     return std::string();
     }
 
   timeStruct = *ptr;
 
   std::string result;
   for(std::string::size_type i = 0; i < formatString.size(); ++i)
     {
     char c1 = formatString[i];
     char c2 = (i+1 < formatString.size()) ?
       formatString[i+1] : static_cast<char>(0);
 
     if(c1 == '%' && c2 != 0)
       {
-      result += AddTimestampComponent(c2, timeStruct);
+      result += AddTimestampComponent(c2, timeT, timeStruct);
       ++i;
       }
     else
       {
       result += c1;
       }
     }
 
   return result;
 }
 
 //----------------------------------------------------------------------------
 std::string cmTimestamp::AddTimestampComponent(
-  char flag, struct tm& timeStruct)
+  char flag, time_t timeT, struct tm& timeStruct)
 {
   std::string formatString = "%";
   formatString += flag;
 
+  bool unixTimestamp = false;
+
   switch(flag)
     {
+    case 'e':
+      unixTimestamp = true;
     case 'd':
     case 'H':
     case 'I':
     case 'j':
     case 'm':
     case 'M':
     case 'S':
     case 'U':
     case 'w':
     case 'y':
     case 'Y':
       break;
     default:
       {
       return formatString;
       }
     }
 
   char buffer[16];
+  size_t size;
 
-  size_t size = strftime(buffer, sizeof(buffer),
-    formatString.c_str(), &timeStruct);
+  if(unixTimestamp)
+    size = snprintf(buffer, sizeof(buffer), "%ld", timeT);
+  else
+    size = strftime(buffer, sizeof(buffer), formatString.c_str(), &timeStruct);
 
   return std::string(buffer, size);
 }
diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h
index 24c1869..45f5b88 100644
--- a/Source/cmTimestamp.h
+++ b/Source/cmTimestamp.h
@@ -16,25 +16,26 @@
 #include <time.h>
 
 /** \class cmTimestamp
  * \brief Utility class to generate sting representation of a timestamp
  *
  */
 class cmTimestamp
 {
 public:
   cmTimestamp() {}
 
   std::string CurrentTime(const std::string& formatString, bool utcFlag);
 
   std::string FileModificationTime(const char* path,
     const std::string& formatString, bool utcFlag);
 
 private:
   std::string CreateTimestampFromTimeT(time_t timeT,
       std::string formatString, bool utcFlag);
 
-  std::string AddTimestampComponent(char flag, struct tm& timeStruct);
+  std::string AddTimestampComponent(char flag,
+      time_t timeT, struct tm& timeStruct);
 };
 
 
 #endif
