format LocalDateTime as dd/MM/yyyy - Java java.time

Java examples for java.time:LocalDateTime

Description

format LocalDateTime as dd/MM/yyyy

Demo Code


//package com.java2s;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
    public static String formatDate(LocalDateTime date) {
        return date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
    }/*from  w w  w .jav a  2 s.co m*/
}

Related Tutorials