huzefaq
asked on
How to get the month from todays date
I actually need the current month. So I was sing the following code
But the problem is that when I print the month, it gives me 5 instead of 6 which is the current month.
Any help will be greatly appreciated. When I print the whole date, it prints the right date
Date todays_date = new Date();
String this_month = new Integer(todays_date.getMon th()).toSt ring();
out.print(this_month);
But the problem is that when I print the month, it gives me 5 instead of 6 which is the current month.
Any help will be greatly appreciated. When I print the whole date, it prints the right date
Date todays_date = new Date();
String this_month = new Integer(todays_date.getMon
out.print(this_month);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.