Java LocalDateTime to toJsonDate(LocalDateTime date)

Here you can find the source of toJsonDate(LocalDateTime date)

Description

Generate a JSON-formatted date string for a given date

License

Open Source License

Parameter

Parameter Description
date The date

Return

The JSON string

Declaration

public static String toJsonDate(LocalDateTime date) 

Method Source Code

//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);
    }
}

Related

  1. toDate(LocalDateTime dateTime)
  2. toDate(LocalDateTime ldt)
  3. toDateHeader(LocalDateTime dt)
  4. toDateUTCFromJST(LocalDateTime dateTime)
  5. toJava8(org.joda.time.LocalDateTime x)
  6. tokenExpired(LocalDateTime expiryDate)
  7. toMinuteCount(LocalDateTime ldt)
  8. toString(LocalDateTime time)
  9. toStringIfPresent(LocalDateTime dateTime)