i have this
class MainController {
def test = {
def day1 =1
def month1 = 10
def year1 = 2011
def date1 = new Date(year1 ,month1, day1);
}
}
But the OutPut is
Wed Nov 01 00:00:00 PKT 3911
Why its 3911 , shouldnt it be 2011 ??
Any solution
Thanks
Read the Date API of this deprecated constructor. You must pass in the year-1900. Also, the month is zero-based (also in the API docs).
That information was also shown in my answer to one of your previous questions.