1
23
24
25
26
27
28
29
30
31
32
33
34
39
// {
Date today = new Date();
System.out.println("Note the time includes the default timezone - " + today.toString());
Date twentySevenFeb2017Date = new Date(117, 1, 27);
System.out.println("Now deprecated new Date(day, month, year) - but note month starts at zero, and year 1900 - " + twentySevenFeb2017Date);
Calendar twentySevenFeb2017Calendar = new GregorianCalendar(2017,1,27);
System.out.println("Calendar - month starts at zero, and but year fixed - " + twentySevenFeb2017Calendar.getTime());
DateFormat ddMMyyySDF = new SimpleDateFormat("dd/MM/yyyy");
System.out.println("DateFormat not ThreadSafe - " + ddMMyyySDF.format(twentySevenFeb2017Date));
//{
Enter to Rename, Shift+Enter to Preview