@Test public void shouldPlayWithDates() { LocalDate d1 = LocalDate.now(); LocalDate d2 = LocalDate.of(2014, 2, 15).plusDays(10); print(d1); print(d2); LocalDateTime d3 = d2.atTime(13, 23, 34, 45); assertThat(d3.toString(), is("2014-02-25T13:23:34.000000045")); LocalDateTime d4 = d3.plus(Period.of(1, 2, 3)); assertThat(d4.toString(), is("2015-04-28T13:23:34.000000045")); }
public String getTimePosted() { // returns time posted as a string return timePosted.toString(); }
public String toString() { return dateAndTime.toString(); }