Java Data Type How to - Show a date in french format








Question

We would like to know how to show a date in french format.

Answer

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
//from w  w  w  .j  av  a 2  s . com
public class Main {

  public static void main(String[] args) {
    String timeStamp = new SimpleDateFormat("EEE MMM dd hh:mm:ss yyyy",
        Locale.FRANCE).format(new Date());
    System.out.println(timeStamp);

  }
}

The code above generates the following result.