Java LocalDateTime Format formatLocalDateTimeToString(LocalDateTime date)

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

Description

Formats a LocalDateTime into a string

License

Open Source License

Declaration

public static String formatLocalDateTimeToString(LocalDateTime date) 

Method Source Code

//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 localDateTimeFormatter = DateTimeFormatter.ofPattern("d MMM yyyy HH:mm");

    /**//from w  w  w .  j av a2  s  . com
     * Formats a LocalDateTime into a string
     */
    public static String formatLocalDateTimeToString(LocalDateTime date) {
        return date.format(localDateTimeFormatter);
    }
}

Related

  1. formatDate(String inPattern, LocalDateTime inTime)
  2. formatDateFromTo(LocalDateTime dateFrom, LocalDateTime dateTo)
  3. formatDateGeneric(DateTimeFormatter dateTimeFormatter, LocalDateTime localDateTime)
  4. formatDateTime(LocalDateTime dateTime)
  5. formatDayOfMonth(LocalDateTime dateTime)
  6. formatShortDate(LocalDateTime dateTime)
  7. formattedWeek(LocalDateTime localDateTime)
  8. formatTime(LocalDateTime dateTime)
  9. formatTime(LocalDateTime time)