Here you can find the source of formatDate(LocalDateTime dateTime)
Parameter | Description |
---|---|
dateTime | LocalDateTime to format. |
public static String formatDate(LocalDateTime dateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { /**/*from ww w. j a v a 2 s . co m*/ * @@author A0139812A * Formats a LocalDateTime to a formatted date, following the dd MMM yyyy format. * * @param dateTime LocalDateTime to format. * @return Formatted date in dd MMM yyyy format. */ public static String formatDate(LocalDateTime dateTime) { return dateTime.format(DateTimeFormatter.ofPattern("dd MMM yyyy")); } }