{-# OPTIONS_GHC -fno-warn-orphans #-}

module Data.Time.Clock.Instances
  (
  ) where

import ClassyPrelude

import Data.Time.Clock

import Data.Binary (Binary)
import qualified Data.Binary as Binary


deriving instance Generic UTCTime


instance Binary Day where
  get = ModifiedJulianDay <$> Binary.get
  put = Binary.put . toModifiedJulianDay

instance Binary DiffTime where
  get = fromRational <$> Binary.get
  put = Binary.put . toRational
  
instance Binary UTCTime
