Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

current date

Status
Not open for further replies.

rhull

Programmer
May 23, 2001
46
US
I am having trouble getting the current date
I assume i import
java.util.Date()

but from the sun web site many of the methods I would use like getMonth are deprecated.

What is a good way to get this done?

Thanks!
-Ryan
 
nervermind, I came up with a solution,

<%@ page import=&quot;java.util.Calendar&quot;%>

Calendar calendar = Calendar.getInstance();
int tempMonth = calendar.get(Calendar.MONTH);
int tempYear = calendar.get(Calendar.YEAR);

-R

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top