From 8ee9da05ed8d6b6538c1453adaf6f3f1f1366806 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 9 Nov 2004 20:29:10 +0000 Subject: [PATCH] Provide conversion from posix time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17656 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/System/TimeValue.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/llvm/System/TimeValue.h b/include/llvm/System/TimeValue.h index bef04dc9a06..71afd863f0e 100644 --- a/include/llvm/System/TimeValue.h +++ b/include/llvm/System/TimeValue.h @@ -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 /// @{