Skip to content

writer_context_demo

Shaojin Wen edited this page Feb 2, 2024 · 1 revision
JSONWriter.Context context = JSONFactory.createWriteContext();
context.setDateFormat("yyyy-MM-dd");

LocalDateTime localDateTime = LocalDateTime.of(2014, 1, 2, 12, 13, 14);
assertEquals("2014-01-02", JSON.toJSONString(localDateTime, context));
Clone this wiki locally