Simple Date format : Date Format « I18N « Java






Simple Date format

Simple Date format
 

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateTimeEditor1 {
  public static void main(String[] args) {
    DateFormat m_format;

    Calendar m_calendar = Calendar.getInstance();

    Date date = new Date();
    String myString = DateFormat.getDateInstance().format(date);
    System.out.println(myString);
  }
}
           
         
  








Related examples in the same category

1.Show DateShow Date
2.Java I18N: Format : Date FormatJava I18N: Format : Date Format
3.Java I18N: Format : Date Format Symbols DemoJava I18N: Format : Date Format Symbols Demo
4.Demonstrate number and date internationalizationDemonstrate number and date internationalization
5.Use some locales choicesUse some locales choices
6.Format some values using the default locale
7.Formatting and Parsing a Time for a Locale Using Default Formats
8.Formatting and Parsing a Time for a Locale: specify the locale when creating the SimpleDateFormat object.
9.Formatting and Parsing a Date for a Locale: specify the locale when creating the SimpleDateFormat object.