This content has been marked as final. Show 6 replies
Try reading the API docs for Date, the class in question.
That should always be the first place you look.
Both Date and Calendar do what you require for free - just create one! :-)
TR, how are you doing? Back from a hiatus, I see.
If all you want is a date for printing or displaying, the easiest way is to use Date as shown below. If you need something more complex, look at the Calendar API.
public static void main(String args)
Date now = new Date();
you shud go through the methods provided with the Date class.
try to explore it.
or go through this solution
Date currentdate= new Date();
make correction in above reply