| |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||||||||||||||
Documentation | |||||||||||||||||||||||||||||||||||
getIsoDateTime :: IO String | |||||||||||||||||||||||||||||||||||
The current time in the format returned by showIsoDateTime | |||||||||||||||||||||||||||||||||||
readLocalDate :: String -> CalendarTime | |||||||||||||||||||||||||||||||||||
Read/interpret a date string, assuming local timezone if not specified in the string | |||||||||||||||||||||||||||||||||||
readUTCDate :: String -> CalendarTime | |||||||||||||||||||||||||||||||||||
Read/interpret a date string, assuming UTC if timezone is not specified in the string (see readDate) Warning! This errors out if we fail to interpret the date | |||||||||||||||||||||||||||||||||||
parseDate :: Int -> String -> Either ParseError MCalendarTime | |||||||||||||||||||||||||||||||||||
Parse a date string, assuming a default timezone if the date string does not specify one. The date formats understood are those of showIsoDateTime and date_time | |||||||||||||||||||||||||||||||||||
getLocalTz :: IO Int | |||||||||||||||||||||||||||||||||||
Return the local timezone offset from UTC in seconds | |||||||||||||||||||||||||||||||||||
englishDateTime :: CalendarTime -> CharParser a CalendarTime | |||||||||||||||||||||||||||||||||||
In English, either a date followed by a time, or vice-versa, e.g,
See englishDate and englishTime Uses its first argument as now, i.e. the time relative to which yesterday, today etc are to be interpreted | |||||||||||||||||||||||||||||||||||
englishInterval :: CalendarTime -> CharParser a TimeInterval | |||||||||||||||||||||||||||||||||||
English expressions for intervals of time,
| |||||||||||||||||||||||||||||||||||
englishLast :: CalendarTime -> CharParser a (CalendarTime, CalendarTime) | |||||||||||||||||||||||||||||||||||
Durations in English that begin with the word "last", E.g. "last 4 months" is treated as the duration between 4 months ago and now | |||||||||||||||||||||||||||||||||||
iso8601_interval :: Int -> CharParser a (Either TimeDiff (MCalendarTime, MCalendarTime)) | |||||||||||||||||||||||||||||||||||
Intervals in ISO 8601, e.g.,
See iso8601_duration | |||||||||||||||||||||||||||||||||||
iso8601_duration :: CharParser a TimeDiff | |||||||||||||||||||||||||||||||||||
Durations in ISO 8601, e.g.,
| |||||||||||||||||||||||||||||||||||
cleanLocalDate :: String -> String | |||||||||||||||||||||||||||||||||||
Convert a date string into ISO 8601 format (yyyymmdd variant) assuming local timezone if not specified in the string Warning! This errors out if we fail to interpret the date | |||||||||||||||||||||||||||||||||||
resetCalendar :: CalendarTime -> CalendarTime | |||||||||||||||||||||||||||||||||||
Set a calendar to UTC time any eliminate any inconsistencies within (for example, where the weekday is given as Thursday, but this does not match what the numerical date would lead one to expect) | |||||||||||||||||||||||||||||||||||
data MCalendarTime | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
subtractFromMCal :: TimeDiff -> MCalendarTime -> MCalendarTime | |||||||||||||||||||||||||||||||||||
addToMCal :: TimeDiff -> MCalendarTime -> MCalendarTime | |||||||||||||||||||||||||||||||||||
toMCalendarTime :: CalendarTime -> MCalendarTime | |||||||||||||||||||||||||||||||||||
Trivially convert a CalendarTime to a fully specified MCalendarTime (note that this sets the mctWeek flag to False | |||||||||||||||||||||||||||||||||||
unsafeToCalendarTime :: MCalendarTime -> CalendarTime | |||||||||||||||||||||||||||||||||||
Returns the first CalendarTime that falls within a MCalendarTime This is only unsafe in the sense that it plugs in default values for fields that have not been set, e.g. January for the month or 0 for the seconds field. Maybe we should rename it something happier. See also resetCalendar | |||||||||||||||||||||||||||||||||||
unsetTime :: CalendarTime -> CalendarTime | |||||||||||||||||||||||||||||||||||
Zero the time fields of a CalendarTime | |||||||||||||||||||||||||||||||||||
type TimeInterval = (Maybe CalendarTime, Maybe CalendarTime) | |||||||||||||||||||||||||||||||||||
Produced by Haddock version 2.6.0 |