Safe Haskell | None |
---|---|
Language | Haskell98 |
Parse strings that aren't so precise
- data DateTime :: * = DateTime {}
- class Timeable t => Time t where
- timeFromElapsedP :: ElapsedP -> t
- timeFromElapsed :: Elapsed -> t
- parseDate :: DateTime -> String -> Either ParseError Date
- parseDateTime :: DateTime -> String -> Either ParseError DateTime
- pDate :: Stream s m Char => DateTime -> ParsecT s st m Date
- pDateTime :: Stream s m Char => DateTime -> ParsecT s st m DateTime
- pTime :: Stream s m Char => ParsecT s st m TimeOfDay
- pDateInterval :: Stream s m Char => ParsecT s st m DateInterval
- tryRead :: (Read a, Stream s m Char) => String -> ParsecT s st m a
- tryReadInt :: (Stream s m Char, Num a) => String -> ParsecT s st m a
- data DateIntervalType
- data DateInterval
- weekdayToInterval :: WeekDay -> DateInterval
- dateWeekDay :: DateTime -> WeekDay
- lastMonday :: DateTime -> DateTime
- nextMonday :: DateTime -> DateTime
- addInterval :: DateTime -> DateInterval -> DateTime
- negateInterval :: DateInterval -> DateInterval
- minusInterval :: DateTime -> DateInterval -> DateTime
Documentation
data DateTime :: *
Date and Time
class Timeable t => Time t where
Represent time types that can be created from other time types.
Every conversion happens throught ElapsedP or Elapsed types.
timeFromElapsedP :: ElapsedP -> t
convert from a number of elapsed seconds and nanoseconds to another time representation
timeFromElapsed :: Elapsed -> t
convert from a number of elapsed seconds and nanoseconds to another time representation
defaults to timeFromElapsedP unless defined explicitely by an instance.
:: DateTime | Current date / time, to use as base for relative dates |
-> String | String to parse |
-> Either ParseError Date |
Parse date/time
:: DateTime | Current date / time, to use as base for relative dates |
-> String | String to parse |
-> Either ParseError DateTime |
Parse date/time
:: Stream s m Char | |
=> DateTime | Current date / time, to use as base for relative dates |
-> ParsecT s st m Date |
Parsec parser for Date only.
:: Stream s m Char | |
=> DateTime | Current date / time, to use as base for relative dates |
-> ParsecT s st m DateTime |
Parsec parser for DateTime.
pDateInterval :: Stream s m Char => ParsecT s st m DateInterval Source
tryRead :: (Read a, Stream s m Char) => String -> ParsecT s st m a Source
Parser version of Prelude.read
data DateIntervalType Source
data DateInterval Source
weekdayToInterval :: WeekDay -> DateInterval Source
Weekday as interval from Monday, so that weekdayToInterval Monday == 0 and weekdayToInterval Sunday == 6.
dateWeekDay :: DateTime -> WeekDay Source
Get weekday of given date.
lastMonday :: DateTime -> DateTime Source
nextMonday :: DateTime -> DateTime Source
addInterval :: DateTime -> DateInterval -> DateTime Source
Add date interval to DateTime
negateInterval :: DateInterval -> DateInterval Source
Negate DateInterval value: Days 3 -> Days (-3).
minusInterval :: DateTime -> DateInterval -> DateTime Source
Subtract DateInterval from DateTime.