Java LocalDateTime to getDateTimeText(LocalDateTime dateTime)

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

Description

Gets the complete date time text in the following format: 12 August 2015, 12:34 PM

License

Open Source License

Declaration

public static String getDateTimeText(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 {
    private static final String FORMAT_FULL_DATE = "d MMMM yyyy, h:mm a";

    /**/*from  w  ww  .  j av  a2  s . co  m*/
     * Gets the complete date time text in the following format:
     *      12 August 2015, 12:34 PM
     */
    public static String getDateTimeText(LocalDateTime dateTime) {
        return dateTime.format(DateTimeFormatter.ofPattern(FORMAT_FULL_DATE));
    }
}

Related

  1. convertLocalDateTimeToDateInUTC(final LocalDateTime ldt)
  2. convertToDate(LocalDateTime dateTime)
  3. fromLocalDateTime(LocalDateTime _ldt)
  4. getDate(LocalDateTime time)
  5. getDelayUntil(final LocalDateTime ldt)
  6. getDifference(LocalDateTime sourceTime, LocalDateTime targetTime)
  7. getDurationInMillis(LocalDateTime from, LocalDateTime to)
  8. getDurationString(LocalDateTime start, LocalDateTime end, ChronoUnit unit)