NiceDate { public String format(String format){ return DateUtils.format(format, calendar.getTime()); } NiceDate();  NiceDate(Date date); static NiceDate New(); static NiceDate Now(); static NiceDate New(Date date); static NiceDate New(String dateStr); static NiceDate New(String dateStr, String format); NiceDate setTimeByString(String timeString); Date getTime(); long getTimeInMillis(); long getMillis(); NiceDate setMillis(long millis); NiceDate setTimeInSeconds(long seconds); void setTime(Date time); NiceDate today(); NiceDate yesterday(); NiceDate nextDay(int number); NiceDate nextHour(int amount); NiceDate nextMonth(int amount); NiceDate nextYear(int amount); NiceDate nextMinute(int amount); NiceDate nextSecond(int amount); NiceDate tomorrow(); NiceDate thisYear(); NiceDate thisMonth(); NiceDate thisHour(); NiceDate thisDate(); NiceDate preciseDate(); NiceDate thisMin(); NiceDate thisSec(); NiceDate thisMisec(); NiceDate atTheBeginning(); NiceDate atTheEnd(); boolean isBetween(Date start, Date end); DatePhase getDatePhase(); boolean isMorning(); boolean isNoon(); boolean isAfternoon(); boolean isNight(); boolean isDeepnight(); String toString(); String format(String format); String formatAsDate(); String formatAsTime(); String formatAsDateTime(); String formatDateTimeMillis(); int getYear(); int getMonth(); int getDayOfMonth(); int getHourOfDay(); boolean isBeforeOrEquals(NiceDate date); boolean isAfterOrEquals(NiceDate date); boolean isBefore(NiceDate date); boolean isAfter(NiceDate date); boolean isEquals(NiceDate date); Duration awayFrom(NiceDate date); static void main(String[] args);  }
@Test public void test() throws ParseException{ LocalDateTime date = LocalDateTime.of(2015, 11, 11, 11, 11, 11, 510000000); String format = date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS")); Assert.assertEquals("2015-11-11 11:11:11 510", format); String str = "Tue, 24 Nov 2015 06:33:31 GMT"; SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH); Date d = sdf.parse(str); System.out.println("parse:"+d.toLocaleString()); }