------------------------- LocalDateTime | ------------------------- # ±íʾʱ¼ä+ÈÕÆÚ # ¹¹Ôì(ͨ¹ý¾²Ì¬·½·¨) LocalDateTime LocalDateTime.now(); * »ñȡϵͳµ±Ç°Ê±¼ä * 2016-05-24T22:41:30.852 LocalDateTime LocalDateTime.of(int year,int month,int dayOfMonth,int hour,int minute,int second); * ¸ù¾ÝÖ¸¶¨µÄÈÕÆÚºÍʱ¼ä·µ»ØLocalDateTime¶ÔÏó LocalDateTime parse(CharSequence text, DateTimeFormatter formatter); * ¸ù¾Ý formatter À´¸ñʽ³ö LocalDateTime ¶ÔÏó LocalDateTime of(LocalDate date, LocalTime time) * ¸ù¾ÝÈÕÆÚºÍʱ¼ä¹¹Ôì * ¿ÉÒÔ¹¹ÔìÒ»¸öÖ¸¶¨ÈÕÆÚ(½ñÌì)µÄ×îСʱ¼äºÍ×î´óʱ¼ä LocalDateTime.of(LocalDate.now(),LocalTime.MAX); 2019-04-18 23:59:59.999999999 LocalDateTime.of(LocalDate.now(),LocalTime.MIN); 2019-04-18 00:00 ------------------------- LocalDateTime-api | ------------------------- # ¶ÁÈ¡Ïà¹Ø int getYear(); * ·µ»ØÈÕÆÚÖеÄÄê·Ý int getMonth(); * ·µ»ØÈÕÆÚÖеÄÔÂ·Ý int getDayOfMonth(); * ·µ»ØÔ·ÝÖеĵڼ¸Ìì int getHour(); * ·µ»ØÐ¡Ê± int getMinute(); * ·µ»Ø·ÖÖÓ int getSecond(); * ·µ»ØÃë int get(TemporalField field) * ¸ù¾Ý²ÎÊý»ñȡָ¶¨µÄÊý¾Ý * ¿ÉÒÔʹÓÃö¾Ù:ChronoField # ÉèÖÃÏà¹Ø LocalDateTime withDayOfMonth(int num); * ÉèÖÃÔÂÖеÄÌìÊý LocalDate toLocalDate(); * ת»»Îª LocalDate ¶ÔÏó LocalTime toLocalTime(); * ת»»Îª LocalTime ¶ÔÏó LocalDateTime plusYears(int year); * Ìí¼Ó¶àÉÙÄê LocalDateTime plusMonths(int month); * Ìí¼Ó¶àÉÙ¸öÔ * '»¹ÓкܶàÌí¼Óʱ·ÖÃëµÄAPI,¶¼Ò»Ñù' LocalDateTime minusWeeks(long weeks) * ·µ»ØNÖÜ֮ǰµÄÏÖÔÚʱ¼ä * '»¹ÓкܶàÌí¼Óʱ·ÖÃëµÄAPI,¶¼Ò»Ñù' # ¸ñʽ»¯Ïà¹Ø String formart(DateTimeFormatter matter); * ¸ù¾Ý DateTimeFormatter ·µ»Ø±»¸ñʽ»¯ºóµÄʱ¼ä×Ö·û´®