calendar.advance problem with Days TimeUnit (bug?)

Posted by Luca Ferraro-3 on
URL: http://quantlib.414.s1.nabble.com/calendar-advance-problem-with-Days-TimeUnit-bug-tp6531.html

Mmmmm, is the advance method thougth to work just to really ADVANCE or also to
get back in the past? It seems there is a problem with the latter ... am I wrong?

Reference Date: January 1st, 2008
Result of calendar.advance(referenceDate,-365,Days) = July 27th, 2006


Using QuantLib-0.9.6 and g++ 4.2.3

original code:

#include <ql/quantlib.hpp>
using namespace QuantLib;

// Simple program to test DayCounters and Calendar advance features
int main() {

    Calendar calendar = TARGET();
    Date referenceDate(1,January,2008);
    std::cout << "\nReference Date: " << referenceDate << std::endl;

    Date verify;
    verify = calendar.advance(referenceDate, -365, Days);
    std::cout << "Result of calendar.advance(referenceDate,-365,Days) = "
<<verify << std::endl;

    return 0;
}



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users