JSP BasicsBeginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
hey guys..i need to know how to get the current month in jsp..as well as how do i get the month from a time stamp.Pls tell me of the classes that need to be imported as well..if there is any.Really appreciate ur help. =]
u can use the calendar class provided by sun.
This should do wat u want,
Calendar cal = Calendar.getInstance();
int iYear = cal.get(Calendar.YEAR);
int iMonth = cal.get(Calendar.MONTH)+1;
int iDate= cal.get(Calendar.DAY_OF_MONTH);