Содержание
- 2. Date and Time Classes Date - represents a specific instant in time, with millisecond precision GregorianCalendar
- 3. Class Date represents a specific instant in time, with millisecond precision new Date() returns current date
- 4. Some Date methods equals(Object obj) - compares dates after(Date date) - compares dates before(Date date) -
- 5. Class Calendar Abstract class that provides methods for converting between a specific instant in time and
- 6. Calendar Methods Calendar rightNow = Calendar.getInstance(); - gets current date and time set(int field, int value)
- 7. Class GregorianCalendar Concrete subclass of Calendar Provides the standard calendar system used by most of the
- 8. Calendar Examples Задание даты: GregorianCalendar calendar = new GregorianCalendar(2012, Calendar.May, 14); Добавление к дате двух недель:
- 9. Date & Calendar Transformations Calendar c = Calendar.getInstance(); Date dt = new Date(); Calendar -> Date
- 10. Class SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner It
- 11. SimpleDateFormat Example SimpleDateFormat dtFrm = new SimpleDateFormat("dd.MM.yyyy"); Date start = new Date(); String txDate = dtFrm.format(start);
- 12. Class Locale represents a specific geographical, political, or cultural region Locale lc = new Locale(”uk”, ”UK”);
- 13. Класс SimpleTimeZone A concrete subclass of TimeZone class that represents a time zone for use with
- 14. SimpleDateFormat Localization SimpleDateFormat dtFrmL = new SimpleDateFormat("dd.MMMM.yyyy", Locale.ENGLISH); Date dt = new Date(); System.out.println("Locale.ENGLISH: " +
- 15. DateFormat Localization DateFormat dtFrmD = DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ENGLISH); System.out.println("Locale.ENGLISH: " + dtFrmD.format(dt)); Locale.ENGLISH: Oct 5, 2013 Locale.GERMAN:
- 16. Date Localization http://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html * Infopulse Training Center
- 17. Exercise 3.3.1 Print the following: Current date Date in 6 weeks Date 4 month before Date
- 18. Exercise 3.3.1 See 331DateActions project for the full text * Infopulse Training Center
- 19. Exercise 3.3.2. Create a static method that gets some date and returns next bank day *
- 20. Exercise 3.3.2. See 332NextBankDay project for full text * Infopulse Training Center
- 22. Скачать презентацию