From: Simon Marlow Date: Fri, 30 Nov 2007 10:16:48 +0000 (+0000) Subject: note about how to convert CTime (aka EpochTime) to UTCTime X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2c773b8ba6d84f23069a2d18baa68148c1e95eb8;p=ghc-base.git note about how to convert CTime (aka EpochTime) to UTCTime --- diff --git a/Foreign/C/Types.hs b/Foreign/C/Types.hs index 04a96ab..a06a259 100644 --- a/Foreign/C/Types.hs +++ b/Foreign/C/Types.hs @@ -186,6 +186,11 @@ INTEGRAL_TYPE(CSigAtomic,tyConCSigAtomic,"CSigAtomic",HTYPE_SIG_ATOMIC_T) -- | Haskell type representing the C @clock_t@ type. ARITHMETIC_TYPE(CClock,tyConCClock,"CClock",HTYPE_CLOCK_T) -- | Haskell type representing the C @time_t@ type. +-- +-- To convert to a @Data.Time.UTCTime@, use the following formula: +-- +-- > posixSecondsToUTCTime (fromRational (toRational t) :: POSIXTime) +-- ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T) -- FIXME: Implement and provide instances for Eq and Storable