To Demonstrate date function
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class Month_Name
{
public static void main(String[] args)
{
Date dt = new Date();
System.out.print(dt.toString());
System.out.println(dt.getMonth()+":"+dt.getDate()+":"+dt.getYear());
Calendar c = new GregorianCalendar();
System.out.println(c.getTime());
System.out.println(c.DATE+"/"+c.MONTH+"/"+c.YEAR);
}
}
No comments:
Post a Comment