Here you can find the source of formatDateTime(LocalDateTime dateTime)
Parameter | Description |
---|---|
dateTime | a parameter |
public static String formatDateTime(LocalDateTime dateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); /**//from ww w . j a v a 2 s .c o m * Returns a string representing dateTime with DATE_TIME_FORMATTER * @param dateTime * @return */ public static String formatDateTime(LocalDateTime dateTime) { return dateTime.format(DATE_TIME_FORMATTER); } }