| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Time.Date
Synopsis
- data Day
- data Month
- data Weekday
- data ImmMonth
- minDate :: Day
- maxDate :: Day
- today :: IO Day
- january :: Int -> Int -> Day
- february :: Int -> Int -> Day
- march :: Int -> Int -> Day
- april :: Int -> Int -> Day
- may :: Int -> Int -> Day
- june :: Int -> Int -> Day
- july :: Int -> Int -> Day
- august :: Int -> Int -> Day
- september :: Int -> Int -> Day
- october :: Int -> Int -> Day
- november :: Int -> Int -> Day
- december :: Int -> Int -> Day
- addEcbDate :: Day -> IO ()
- removeEcbDate :: Day -> IO ()
- endOfMonth :: Day -> IO Day
- nextWeekday :: Day -> Weekday -> IO Day
- nthWeekday :: Word -> Weekday -> Month -> Int -> IO Day
- addPeriod :: Day -> (Int, TimeUnit) -> IO Day
- immCode :: Day -> IO String
- immDate :: String -> Day -> IO Day
- nextImmCode :: Day -> Bool -> IO String
- nextImmCodeFromCode :: String -> Bool -> Day -> IO String
- nextImmDate :: Day -> Bool -> IO Day
- nextImmDateFromCode :: String -> Bool -> Day -> IO Day
- ecbCode :: Day -> IO String
- ecbDateFromCode :: String -> Maybe Day -> IO Day
- ecbDate :: Month -> Int -> IO Day
- nextEcbCodeFromCode :: String -> IO String
- nextEcbCode :: Maybe Day -> IO String
- nextEcbDateFromCode :: String -> Maybe Day -> IO Day
- nextEcbDate :: Maybe Day -> IO Day
- nextEcbDatesFromCode :: String -> Maybe Day -> IO [Day]
- nextEcbDates :: Maybe Day -> IO [Day]
- isLeap :: Day -> Bool
- year :: Day -> Int
- month :: Day -> Month
- weekday :: Day -> IO Weekday
- dayOfYear :: Day -> IO Int
- isEndOfMonth :: Day -> IO Bool
- isImmCode :: String -> Bool -> Bool
- isImmDate :: Day -> Bool -> IO Bool
- isEcbCode :: String -> IO Bool
- isEcbDate :: Day -> IO Bool
- knownEcbDates :: IO [Day]
Types
The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.
Instances
| NFData Day | |
Defined in Data.Time.Calendar.Days | |
| Data Day | |
Defined in Data.Time.Calendar.Days Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day # dataTypeOf :: Day -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Day) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) # gmapT :: (forall b. Data b => b -> b) -> Day -> Day # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r # gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day # | |
| Enum Day | |
| Ix Day | |
| Read Day | |
| Show Day | |
| Eq Day | |
| Ord Day | |
| DayPeriod Day | |
Defined in Data.Time.Calendar.Days | |
| FormatTime Day | |
Defined in Data.Time.Format.Format.Instances Methods formatCharacter :: Bool -> Char -> Maybe (FormatOptions -> Day -> String) # | |
| ISO8601 Day |
|
Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format Day # | |
| ParseTime Day | |
Defined in Data.Time.Format.Parse.Instances Methods substituteTimeSpecifier :: Proxy Day -> TimeLocale -> Char -> Maybe String # parseTimeSpecifier :: Proxy Day -> TimeLocale -> Maybe ParseNumericPadding -> Char -> ReadP String # | |
returns TRUE if the given date's year is leap
Constructors
| January | |
| Jan | |
| February | |
| Feb | |
| March | |
| Mar | |
| April | |
| Apr | |
| May | |
| June | |
| Jun | |
| July | |
| Jul | |
| August | |
| Aug | |
| September | |
| Sep | |
| October | |
| Oct | |
| November | |
| Nov | |
| December | |
| Dec |
Instances
| Bounded Weekday Source # | |
| Enum Weekday Source # | |
| Read Weekday Source # | |
| Show Weekday Source # | |
| Eq Weekday Source # | |
| Ord Weekday Source # | |
Instances
| Bounded ImmMonth Source # | |
| Enum ImmMonth Source # | |
Defined in QuantLib.Time.Date | |
| Read ImmMonth Source # | |
| Show ImmMonth Source # | |
| Eq ImmMonth Source # | |
| Ord ImmMonth Source # | |
Defined in QuantLib.Time.Date | |
Constructors
Bounds and current date
Months
january :: Int -> Int -> Day Source #
helper function that is convenient for use as an infix operator
Mutators
addEcbDate :: Day -> IO () Source #
adds a date to the set of known ECB maintenance period start dates
removeEcbDate :: Day -> IO () Source #
removes a date from the set of known ECB maintenance period start dates
Inspectors
Date arithmetic
nextWeekday :: Day -> Weekday -> IO Day Source #
next given weekday following or equal to the given date E.g., the Friday following Tuesday, January 15th, 2002 was January 18th, 2002.see http://www.cpearson.com/excel/DateTimeWS.htm
nthWeekday :: Word -> Weekday -> Month -> Int -> IO Day Source #
n-th given weekday in the given month and year E.g., the 4th Thursday of March, 1998 was March 26th, 1998.see http://www.cpearson.com/excel/DateTimeWS.htm Warning It raises an exception unless the n-th falls in 1..5
IMM dates and codes
immCode :: Day -> IO String Source #
returns the IMM code for the given date (e.g. H3 for March 20th, 2013). Warning It raises an exception if the input date is not an IMM date
immDate :: String -> Day -> IO Day Source #
returns the IMM date for the given IMM code (e.g. March 20th, 2013 for H3). Warning It raises an exception if the input string is not an IMM code
next IMM code following the given date returns the IMM code for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.
next IMM code following the given code returns the IMM code for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.
next IMM date following the given date returns the 1st delivery date for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.
next IMM date following the given IMM code returns the 1st delivery date for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.
ECB maintenance dates
ecbCode :: Day -> IO String Source #
returns the ECB code for the given date (e.g. MAR10 for March xxth, 2010).Warning It raises an exception if the input date is not an ECB date
ecbDateFromCode :: String -> Maybe Day -> IO Day Source #
returns the ECB date for the given ECB code (e.g. March xxth, 2013 for MAR10).WarningIt raises an exception if the input string is not an ECB code
nextEcbDateFromCode :: String -> Maybe Day -> IO Day Source #
next maintenance period start date following the given ECB code
nextEcbDate :: Maybe Day -> IO Day Source #
next maintenance period start date following the given date
nextEcbDatesFromCode :: String -> Maybe Day -> IO [Day] Source #
next maintenance period start dates following the given code
nextEcbDates :: Maybe Day -> IO [Day] Source #
next maintenance period start dates following the given date
Date fields
IMM and ECB predicates
returns whether or not the given string is an IMM code
returns whether or not the given date is an IMM date
isEcbDate :: Day -> IO Bool Source #
returns whether or not the given date is a maintenance period start date
knownEcbDates :: IO [Day] Source #
the set of known ECB maintenance period start dates