> Look at the
> [url=http://java.sun.com/javase/6/docs/api/index.html?
> java/util/Date.html]Date API[/url]
Actually the Calendar class would be better to use, since you can set all the different fields from year to second, plus things like day of week, day of month, week of year, etc.
too slow
Message was edited by:
hunter9000
This is part of the code Im using
SimpleDateFormat date = new SimpleDateFormat("independence day = ' MMMM d'th' yyyy");
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(1776, 6, 4);
im kind of new at this so what i cant do is put a print code because everything I have tried creates a compiler error
SimpleDateFormat formatter = new SimpleDateFormat("MMMM dd, yyyy");
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(1902, Calendar.MAY, 20);
System.out.println(formatter.format(cal.getTime()));
Note that the month number is 0-based. O is January, 1 is February etc... So if you can it's a good idea to use constants like Calendar.MAY.