Java LocalDateTime Format formatDate(LocalDateTime dateTime)

Here you can find the source of formatDate(LocalDateTime dateTime)

Description

format Date

License

Open Source License

Parameter

Parameter Description
dateTime LocalDateTime to format.

Return

Formatted date in dd MMM yyyy format.

Declaration

public static String formatDate(LocalDateTime dateTime) 

Method Source Code

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

Related

  1. convertDateStringToLocalDateTime(String formattedValue, int hour, int minute)
  2. convertTemporalToSplunkSearchFormat(OffsetDateTime localDateTime)
  3. format(LocalDateTime dateTime)
  4. format(LocalDateTime localDateTime, String pattern)
  5. formatDate(String inPattern, LocalDateTime inTime)
  6. formatDateFromTo(LocalDateTime dateFrom, LocalDateTime dateTo)
  7. formatDateGeneric(DateTimeFormatter dateTimeFormatter, LocalDateTime localDateTime)
  8. formatDateTime(LocalDateTime dateTime)