Here you can find the source of toJsonDate(LocalDateTime date)
Parameter | Description |
---|---|
date | The date |
public static String toJsonDate(LocalDateTime date)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; public class Main { /**/*from w w w.j a va2 s .co m*/ * A formatter for generating JSON format dates */ private static java.time.format.DateTimeFormatter jsonFormatter = null; /** * Generate a JSON-formatted date string for a given date * @param date The date * @return The JSON string */ public static String toJsonDate(LocalDateTime date) { return jsonFormatter.format(date); } }