How to make this date validation

Hello

I want a method that returns the 9 months before today. I mean the current date - 9 months. And I want to go oracle.jbo.domian.Date

This is the method that I try to use, but it returns an incorrect value

    public oracle.jbo.domain.Date minDate(){      
        oracle.jbo.domain.Date current = new oracle.jbo.domain.Date();      
        System.out.println(current);      
        oracle.jbo.domain.Date maxdate =(oracle.jbo.domain.Date)current.addMonths(-9);
        System.out.println(maxdate);
        return maxdate;
    }


put method is:

course: 01/01/1970

MaxDate: 04/01/1969

It seems that this line "current oracle.jbo.domain.Date = new oracle.jbo.domain.Date ();' does not return the current date."

Help, please

Hello

I find the solution

oracle.jbo.domain.Date public minDate() {}

DateTime = new java.sql.Timestamp java.sql.Timestamp (System.currentTimeMillis ());

current oracle.jbo.domain.Date = new oracle.jbo.domain.Date (datetime);

System.out.println (Current);

maxdate = (oracle.jbo.domain.Date) current.addMonths(-9) oracle.jbo.domain.Date;

System.out.println (MaxDate);

return maxdate.

}

Tags: Java

Similar Questions

Maybe you are looking for