thyme-0.3.5.5: A faster time library

Safe Haskell | None
Language | Haskell2010

Data.Thyme.Format.Aeson

Contents

- Orphan instances

Description

Instances of `FromJSON` and `ToJSON` for `UTCTime` and `ZonedTime`, along with a newtype wrapper `DotNetTime`.

Synopsis

- newtype DotNetTime = DotNetTime {
  - fromDotNetTime :: UTCTime
  }

# Documentation

newtype DotNetTime Source #

A newtype wrapper for `UTCTime` that uses the same non-standard serialization format as Microsoft .NET, whose `System.DateTime` type is by default serialized to JSON as in the following example:

    /Date(1302547608878)/

The number represents milliseconds since the Unix epoch.

Constructors

DotNetTime |

Fields

- fromDotNetTime :: UTCTime

#### Instances

Instances details

Eq DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods (==) :: DotNetTime -> DotNetTime -> Bool (/=) :: DotNetTime -> DotNetTime -> Bool
Ord DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods compare :: DotNetTime -> DotNetTime -> Ordering (<) :: DotNetTime -> DotNetTime -> Bool (<=) :: DotNetTime -> DotNetTime -> Bool (>) :: DotNetTime -> DotNetTime -> Bool (>=) :: DotNetTime -> DotNetTime -> Bool max :: DotNetTime -> DotNetTime -> DotNetTime min :: DotNetTime -> DotNetTime -> DotNetTime
Read DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods readsPrec :: Int -> ReadS DotNetTime readList :: ReadS [DotNetTime] readPrec :: ReadPrec DotNetTime readListPrec :: ReadPrec [DotNetTime]
Show DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods showsPrec :: Int -> DotNetTime -> ShowS show :: DotNetTime -> String showList :: [DotNetTime] -> ShowS
ToJSON DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods toJSON :: DotNetTime -> Value Source # toEncoding :: DotNetTime -> Encoding Source # toJSONList :: [DotNetTime] -> Value Source # toEncodingList :: [DotNetTime] -> Encoding Source #
FromJSON DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods parseJSON :: Value -> Parser DotNetTime Source # parseJSONList :: Value -> Parser [DotNetTime] Source #
FormatTime DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods showsTime :: TimeLocale -> DotNetTime -> (Char -> ShowS) -> Char -> ShowS Source #

# Orphan instances

ToJSON UTCTime Source # |
Instance details Methods toJSON :: UTCTime -> Value Source # toEncoding :: UTCTime -> Encoding Source # toJSONList :: [UTCTime] -> Value Source # toEncodingList :: [UTCTime] -> Encoding Source #
ToJSON ZonedTime Source # |
Instance details Methods toJSON :: ZonedTime -> Value Source # toEncoding :: ZonedTime -> Encoding Source # toJSONList :: [ZonedTime] -> Value Source # toEncodingList :: [ZonedTime] -> Encoding Source #
FromJSON UTCTime Source # |
Instance details Methods parseJSON :: Value -> Parser UTCTime Source # parseJSONList :: Value -> Parser [UTCTime] Source #
FromJSON ZonedTime Source # |
Instance details Methods parseJSON :: Value -> Parser ZonedTime Source # parseJSONList :: Value -> Parser [ZonedTime] Source #