Java LocalDateTime Format formatTime(LocalDateTime dateTime)

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

Description

format Time

License

Open Source License

Declaration

public static String formatTime(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 {
    public static final String FORMAT_TIME = "hh:mm a";

    public static String formatTime(LocalDateTime dateTime) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(FORMAT_TIME);
        return dateTime.format(formatter);
    }/* w ww . j  a v  a 2s .co  m*/
}

Related

  1. formatDateTime(LocalDateTime dateTime)
  2. formatDayOfMonth(LocalDateTime dateTime)
  3. formatLocalDateTimeToString(LocalDateTime date)
  4. formatShortDate(LocalDateTime dateTime)
  5. formattedWeek(LocalDateTime localDateTime)
  6. formatTime(LocalDateTime time)
  7. localDateTime2Str(LocalDateTime localDateTime, String dateTimeFormatter)
  8. toDoubleExcelFormat(LocalDateTime date, boolean date1904)
  9. toLocalDateTime(String date, DateTimeFormatter formatter)