Java LocalDateTime Format localDateTime2Str(LocalDateTime localDateTime, String dateTimeFormatter)

Here you can find the source of localDateTime2Str(LocalDateTime localDateTime, String dateTimeFormatter)

Description

local Date Time Str

License

Open Source License

Declaration

public static String localDateTime2Str(LocalDateTime localDateTime, String dateTimeFormatter) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.*;
import java.time.format.DateTimeFormatter;

public class Main {

    public static String localDateTime2Str(LocalDateTime localDateTime, String dateTimeFormatter) {
        return localDateTime.format(DateTimeFormatter.ofPattern(dateTimeFormatter));
    }//  w  w  w  . j  av a 2 s . co m

    public static String localDateTime2Str(LocalDateTime localDateTime) {
        return localDateTime.format(DateTimeFormatter.ISO_DATE_TIME);
    }
}

Related

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