Thanks very much.. This will be very useful.
------------------------------------------------------------------------------I'm trying to parse the below date using the DateParser::parseFormatted method but I'm not having any luck.
I can use this method but for a date string formatted dd/mm/yyyy it outputs the wrong year.
How do I correct this.
d.year should equal 2016 but instead I get 2020 because the only date the date parser seems to take is dd/mm/yy
#include <iostream>#include <ql/quantlib.hpp>#include <ql/utilities/dataparsers.hpp>
using namespace std;using namespace QuantLib;
int main(){
Calendar cal = Australia();// convert a string to a date.
string mydate = "05/08/2016";const Date d = DateParser::parseFormatted(mydate,"%d/%m/%y");
cout << "The year of this date is: " << d.year() << endl;
}
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Free forum by Nabble | Disable Popup Ads | Edit this page |