1Date and time calculations(3) QuantLib Date and time calculations(3)
2
3
4
6 Date and time calculations -
7
9 The concrete class QuantLib::Date implements the concept of date. Its
10 functionalities include:
11
12 · providing basic information such as weekday, day of the month, day of
13 the year, month, and year;
14
15 · comparing two dates to determine whether they are equal, or which one
16 is the earlier or later, or the difference between them expressed in
17 days;
18
19 · incrementing or decrementing a date of a given number of days, or of
20 a given period expressed in weeks, months, or years.
21
22 Modules
23 Calendars
24 Day counters
25
26 Classes
27 class DayCounter
28 day counter class
29 class Calendar
30 calendar class
31 class Date
32 Concrete date class.
33 class Period
34 Time period described by a number of a given time unit.
35
36 Typedefs
37 typedef Integer Day
38 Day number.
39 typedef Integer Year
40 Year number.
41
42 Enumerations
43 enum BusinessDayConvention { Following, ModifiedFollowing, Preceding,
44 ModifiedPreceding, Unadjusted }
45 Business Day conventions.
46 enum Month { January = 1, February = 2, March = 3, April = 4, May =
47 5, June = 6, July = 7, August = 8, September = 9, October =
48 10, November = 11, December = 12, Jan = 1, Feb = 2, Mar = 3,
49 Apr = 4, Jun = 6, Jul = 7, Aug = 8, Sep = 9, Oct = 10, Nov =
50 11, Dec = 12 }
51 Month names.
52 enum Frequency { NoFrequency = -1, Once = 0, Annual = 1, Semiannual
53 = 2, EveryFourthMonth = 3, Quarterly = 4, Bimonthly = 6,
54 Monthly = 12, Biweekly = 26, Weekly = 52, Daily = 365 }
55 Frequency of events.
56 enum TimeUnit { Days, Weeks, Months, Years }
57 Units used to describe time periods.
58 enum Weekday { Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4,
59 Thursday = 5, Friday = 6, Saturday = 7, Sun = 1, Mon = 2, Tue
60 = 3, Wed = 4, Thu = 5, Fri = 6, Sat = 7 }
61
63 typedef Integer Day
64 Day number.
65
66 typedef Integer Year
67 Year number.
68
70 enum BusinessDayConvention
71 Business Day conventions.
72
73 These conventions specify the algorithm used to adjust a date in case
74 it is not a valid business day.
75
76 Enumerator:
77
78 Following
79 Choose the first business day after the given holiday.
80
81 ModifiedFollowing
82 Choose the first business day after the given holiday unless it
83 belongs to a different month, in which case choose the first
84 business day before the holiday.
85
86 Preceding
87 Choose the first business day before the given holiday.
88
89 ModifiedPreceding
90 Choose the first business day before the given holiday unless it
91 belongs to a different month, in which case choose the first
92 business day after the holiday.
93
94 Unadjusted
95 Do not adjust.
96
97 enum Month
98 Month names.
99
100 enum Frequency
101 Frequency of events.
102
103 Enumerator:
104
105 NoFrequency
106 null frequency
107
108 Once only once, e.g., a zero-coupon
109
110 Annual once a year
111
112 Semiannual
113 twice a year
114
115 EveryFourthMonth
116 every fourth month
117
118 Quarterly
119 every third month
120
121 Bimonthly
122 every second month
123
124 Monthly
125 once a month
126
127 Biweekly
128 every second week
129
130 Weekly once a week
131
132 Daily once a day
133
134 enum TimeUnit
135 Units used to describe time periods.
136
137 enum Weekday
138 Day's serial number MOD 7; WEEKDAY Excel function is the same except
139 for Sunday = 7.
140
141
142
143Version 0.8.1 29 Oct 2007 Date and time calculations(3)