Example usage for java.text DateFormat DATE_FIELD

List of usage examples for java.text DateFormat DATE_FIELD

Introduction

In this page you can find the example usage for java.text DateFormat DATE_FIELD.

Prototype

int DATE_FIELD

To view the source code for java.text DateFormat DATE_FIELD.

Click Source Link

Document

Useful constant for DATE field alignment.

Usage

From source file:Main.java

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

    SimpleDateFormat formatter = new SimpleDateFormat();

    StringBuffer sb = new StringBuffer();
    formatter.format(new Date(), sb, new FieldPosition(DateFormat.DATE_FIELD));
    System.out.println(sb);/*from ww  w  .java2  s.co m*/
}