Provide conversion from posix time.
authorReid Spencer <rspencer@reidspencer.com>
Tue, 9 Nov 2004 20:29:10 +0000 (20:29 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 9 Nov 2004 20:29:10 +0000 (20:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17656 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/System/TimeValue.h

index bef04dc9a06b593cbcbb8dd1f79a8da04e68d191..71afd863f0e92ec66ed6a53b9933e7e11ce49c3b 100644 (file)
@@ -315,6 +315,15 @@ namespace sys {
       this->normalize();
     }
 
+    /// Converts the \p seconds argument from PosixTime to the corresponding
+    /// TimeValue and assigns that value to \p this.
+    /// @brief Convert seconds form PosixTime to TimeValue
+    void fromPosixTime( SecondsType seconds  ) {
+      seconds_ = seconds + PosixZeroTime.seconds_;
+      nanos_ = 0;
+      this->normalize();
+    }
+
   /// @}
   /// @name Implementation
   /// @{