Format a time in Italian locale short format in Java

Description

The following code shows how to format a time in Italian locale short format.

Example


/*w  w w  .j  av a 2  s.c om*/
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
  public static void main(String[] argv) throws Exception {

    Locale locale = Locale.ITALIAN;
    Date date = new Date();

    String s = DateFormat.getTimeInstance(DateFormat.SHORT, locale).format(date);
    System.out.println(s);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Date »




Date Get
Date Set
Date Format
Date Compare
Date Convert
Date Calculation
Date Parse
Timezone