summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2014-05-09 11:51:56 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2014-05-09 11:51:56 +0200
commit12dc25de1781f33c6f54826bc6b6ae6ce690b4e4 (patch)
tree537b4827ccdcafab88cb495ad2c822c6ccbffdd8 /src
parent0639a73c24508a93e422d97d126d8ec261ecb77e (diff)
parentd86b4753d4811a0f1bd1004e83296238c83a383a (diff)
downloadhakyll-12dc25de1781f33c6f54826bc6b6ae6ce690b4e4.tar.gz
Merge pull request #252 from blaenk/mod-time
save modification time with sub-second granularity
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Core/Provider/Internal.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Hakyll/Core/Provider/Internal.hs b/src/Hakyll/Core/Provider/Internal.hs
index fdf1342..34400fd 100644
--- a/src/Hakyll/Core/Provider/Internal.hs
+++ b/src/Hakyll/Core/Provider/Internal.hs
@@ -31,8 +31,7 @@ import Data.Maybe (fromMaybe)
import Data.Monoid (mempty)
import Data.Set (Set)
import qualified Data.Set as S
-import Data.Time (Day (..), UTCTime (..),
- secondsToDiffTime)
+import Data.Time (Day (..), UTCTime (..))
import Data.Typeable (Typeable)
import System.Directory (getModificationTime)
import System.FilePath (addExtension, (</>))
@@ -62,11 +61,11 @@ newtype BinaryTime = BinaryTime {unBinaryTime :: UTCTime}
--------------------------------------------------------------------------------
instance Binary BinaryTime where
put (BinaryTime (UTCTime (ModifiedJulianDay d) dt)) =
- put d >> put (floor dt :: Integer)
+ put d >> put (toRational dt)
get = fmap BinaryTime $ UTCTime
<$> (ModifiedJulianDay <$> get)
- <*> (secondsToDiffTime <$> get)
+ <*> (fromRational <$> get)
--------------------------------------------------------------------------------