@@ -0,0 +1,1209 @@
+package week11;%0A%0Aimport java.text.DateFormat;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.GregorianCalendar;%0Aimport java.util.TimeZone;%0A%0Apublic class DateAndCalExample %7B%0A%09%0A%09static DateFormat dateformatter = %0A%09%09%09new SimpleDateFormat(%22yyyy-MM-dd HH:mm:ss Z%22); %0A%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09// what is date%0A%0A%09%09long ts = System.currentTimeMillis();%0A%09%09System.out.println(ts);%0A%09%09%0A%09%09Date now = new Date();%0A%09%09System.out.println(now);%0A%09%09System.out.println(dateformatter.format(now));%0A%0A%09%09System.out.println();%0A%09%09%0A%09%09// what is calendar%0A%09%09Calendar cal = new GregorianCalendar();%0A%09%09cal.set(Calendar.MILLISECOND, 0);%0A%09%09cal.set(Calendar.SECOND, 0);%0A%09%09cal.set(Calendar.MINUTE, 0);%0A%09%09cal.set(Calendar.HOUR, 0);%0A%09%0A%09%09cal.setTimeZone(TimeZone.getTimeZone(%22UTC%22));%0A%09%09System.out.println(cal.getTime());%0A%09%09System.out.println(dateformatter.format(cal.getTime()));%0A%09%09%0A%09%09System.out.println();%0A%09%09%0A%09%09// what is timezone%0A%09%09// set timezone on formatter / calendar.%0A%0A%09%09Date today = new Date();%0A%09%09dateformatter.setTimeZone(TimeZone.getTimeZone(%22UTC%22));%0A%09%0A%09%09System.out.println(dateformatter.format(today));%0A%09%09%0A%09%09// why use either?%0A%09%09// how to format?%0A%09%09%0A%09%09%0A%09%09%0A%09%7D%0A%0A%7D%0A

Create DateAndCalExample.java