Java DateTimeFormatter parseAndFormat(String date, DateTimeFormatter fromFormatter, DateTimeFormatter toFormatter)

Here you can find the source of parseAndFormat(String date, DateTimeFormatter fromFormatter, DateTimeFormatter toFormatter)

Description

parse And Format

License

Open Source License

Declaration

public static String parseAndFormat(String date, DateTimeFormatter fromFormatter,
            DateTimeFormatter toFormatter) 

Method Source Code


//package com.java2s;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
    public static String parseAndFormat(String date, DateTimeFormatter fromFormatter,
            DateTimeFormatter toFormatter) {
        LocalDateTime localDateTime = LocalDateTime.parse(date, fromFormatter);
        return localDateTime.format(toFormatter);
    }/*from   w ww  .  j av a2 s  .  c  o m*/
}

Related

  1. getTimestampedPath(Path baseFile, TemporalAccessor time, DateTimeFormatter formatter)
  2. parse(DateTimeFormatter formatter, String string)
  3. parse(final DateTimeFormatter formatter, final String value, final ZoneId zoneId)
  4. parse(String _date, String _format)
  5. parse(String format, String datetime)
  6. parseDateTime(String dateTimeStr, String format)
  7. parseZoneDateTime(String value, DateTimeFormatter formatter)
  8. setDateFormat(String pattern)
  9. validateDate(String input, DateTimeFormatter formatter)