thyme-0.3.5.5: A faster time library

Safe Haskell | None
Language | Haskell2010

Data.Thyme.Format

Contents

- Orphan instances

Synopsis

- class FormatTime t where
  - showsTime :: TimeLocale -> t -> (Char -> ShowS) -> Char -> ShowS
- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- class ParseTime t where
  - buildTime :: TimeParse -> t
- parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t
- readTime :: ParseTime t => TimeLocale -> String -> String -> t
- readsTime :: ParseTime t => TimeLocale -> String -> ReadS t
- data TimeParse = TimeParse {
  - tpCentury :: !Int
  - tpCenturyYear :: !Int
  - tpMonth :: !Month
  - tpWeekOfYear :: !WeekOfYear
  - tpDayOfMonth :: !DayOfMonth
  - tpDayOfYear :: !DayOfYear
  - tpDayOfWeek :: !DayOfWeek
  - tpFlags :: !Int
  - tpHour :: !Hour
  - tpMinute :: !Minute
  - tpSecond :: !Int
  - tpSecFrac :: !DiffTime
  - tpPOSIXTime :: !POSIXTime
  - tpTimeZone :: !TimeZone
  }
- timeParser :: TimeLocale -> String -> Parser TimeParse

# Documentation

class FormatTime t where Source #

Methods

showsTime :: TimeLocale -> t -> (Char -> ShowS) -> Char -> ShowS Source #

#### Instances

Instances details

FormatTime MondayWeek Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> MondayWeek -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime SundayWeek Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> SundayWeek -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime WeekDate Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> WeekDate -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime MonthDay Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> MonthDay -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime OrdinalDate Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> OrdinalDate -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime YearMonthDay Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> YearMonthDay -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime Day Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> Day -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime UniversalTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> UniversalTime -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime UTCTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> UTCTime -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime TimeOfDay Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> TimeOfDay -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime TimeZone Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> TimeZone -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime LocalTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> LocalTime -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime ZonedTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> ZonedTime -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime AbsoluteTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> AbsoluteTime -> (Char -> ShowS) -> Char -> ShowS Source #
FormatTime DotNetTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods showsTime :: TimeLocale -> DotNetTime -> (Char -> ShowS) -> Char -> ShowS Source #

formatTime :: FormatTime t => TimeLocale -> String -> t -> String Source #

class ParseTime t where Source #

Methods

buildTime :: TimeParse -> t Source #

#### Instances

Instances details

ParseTime MondayWeek Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> MondayWeek Source #
ParseTime SundayWeek Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> SundayWeek Source #
ParseTime WeekDate Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> WeekDate Source #
ParseTime MonthDay Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> MonthDay Source #
ParseTime OrdinalDate Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> OrdinalDate Source #
ParseTime YearMonthDay Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> YearMonthDay Source #
ParseTime Day Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> Day Source #
ParseTime UniversalTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> UniversalTime Source #
ParseTime UTCTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> UTCTime Source #
ParseTime TimeOfDay Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> TimeOfDay Source #
ParseTime TimeZone Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> TimeZone Source #
ParseTime LocalTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> LocalTime Source #
ParseTime ZonedTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> ZonedTime Source #
ParseTime AbsoluteTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> AbsoluteTime Source #

parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t Source #

readTime :: ParseTime t => TimeLocale -> String -> String -> t Source #

readsTime :: ParseTime t => TimeLocale -> String -> ReadS t Source #

data TimeParse Source #

Constructors

TimeParse |

Fields

- tpCentury :: !Int
- tpCenturyYear :: !Int
- tpMonth :: !Month
- tpWeekOfYear :: !WeekOfYear
- tpDayOfMonth :: !DayOfMonth
- tpDayOfYear :: !DayOfYear
- tpDayOfWeek :: !DayOfWeek
- tpFlags :: !Int
- tpHour :: !Hour
- tpMinute :: !Minute
- tpSecond :: !Int
- tpSecFrac :: !DiffTime
- tpPOSIXTime :: !POSIXTime
- tpTimeZone :: !TimeZone

#### Instances

Instances details

Show TimeParse Source # |
Instance details Defined in Data.Thyme.Format Methods showsPrec :: Int -> TimeParse -> ShowS show :: TimeParse -> String showList :: [TimeParse] -> ShowS

timeParser :: TimeLocale -> String -> Parser TimeParse Source #

Time `Parser` for UTF-8 encoded `ByteString`s.

Attoparsec easily beats any `String` parser out there, but we do have to be careful to convert the input to UTF-8 `ByteString`s.

# Orphan instances

Read Day Source # |
Instance details Methods readsPrec :: Int -> ReadS Day readList :: ReadS [Day] readPrec :: ReadPrec Day readListPrec :: ReadPrec [Day]
Read UTCTime Source # |
Instance details Methods readsPrec :: Int -> ReadS UTCTime readList :: ReadS [UTCTime] readPrec :: ReadPrec UTCTime readListPrec :: ReadPrec [UTCTime]
Read UTCView Source # |
Instance details Methods readsPrec :: Int -> ReadS UTCView readList :: ReadS [UTCView] readPrec :: ReadPrec UTCView readListPrec :: ReadPrec [UTCView]
Read TimeOfDay Source # |
Instance details Methods readsPrec :: Int -> ReadS TimeOfDay readList :: ReadS [TimeOfDay] readPrec :: ReadPrec TimeOfDay readListPrec :: ReadPrec [TimeOfDay]
Read LocalTime Source # |
Instance details Methods readsPrec :: Int -> ReadS LocalTime readList :: ReadS [LocalTime] readPrec :: ReadPrec LocalTime readListPrec :: ReadPrec [LocalTime]
Read ZonedTime Source # |
Instance details Methods readsPrec :: Int -> ReadS ZonedTime readList :: ReadS [ZonedTime] readPrec :: ReadPrec ZonedTime readListPrec :: ReadPrec [ZonedTime]