@Test
void nanoFractionOfDateField() {

    assertThat(JSON.toJSON(LocalDateTime.of(2019, 4, 25, 1, 0, 0, 200000000)))
            .isEqualTo("\"2019-04-25T01:00:00.200\"");
    assertThat(JSON.toJSON(LocalDateTime.of(2019, 4, 25, 1, 0, 0, 0)))
            .isEqualTo("\"2019-04-25T01:00:00.000\"");
    assertThat(JSON.toJSON(ZonedDateTime.of(2019, 4, 25, 1, 0, 0, 200000000, ZoneId.of("UTC"))))
            .isEqualTo("\"2019-04-25T01:00:00.200Z\"");
    assertThat(JSON.toJSON(ZonedDateTime.of(2019, 4, 25, 1, 0, 0, 0, ZoneId.of("UTC"))))
            .isEqualTo("\"2019-04-25T01:00:00Z\"");
    assertThat(JSON.toJSON(ZonedDateTime.of(2019, 4, 25, 1, 0, 0, 0, ZoneId.of("America/New_York"))))
            .isEqualTo("\"2019-04-25T05:00:00Z\"");  // New york is UTC+5
    assertThat(JSON.toJSON(LocalTime.of(18, 0)))
            .isEqualTo("\"18:00:00.000\"");
    assertThat(JSON.toJSON(LocalTime.of(18, 1, 2, 200000000)))
            .isEqualTo("\"18:01:02.200\"");
    assertThat(JSON.toJSON(LocalTime.of(18, 1, 2, 123456789)))
            .isEqualTo("\"18:01:02.123456789\"");
}