Example usage for java.text DateFormat LONG

List of usage examples for java.text DateFormat LONG

Introduction

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

Prototype

int LONG

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

Click Source Link

Document

Constant for long style pattern.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.LONG);

    String s = dateFormat.format(new Date());
    System.out.println(dateFormat.getNumberFormat().getMinimumFractionDigits());

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.LONG);

    String s = dateFormat.format(new Date());
    System.out.println(s);//from ww  w . j a va  2  s. c om

}

From source file:DateFormatDemo.java

public static void main(String args[]) {
    Date date = new Date();
    DateFormat df = DateFormat.getTimeInstance(DateFormat.LONG);
    System.out.println("Long form: " + df.format(date));
}

From source file:DateFormatDemo.java

public static void main(String args[]) {
    Date date = new Date();
    DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
    System.out.println("Long form: " + df.format(date));

}

From source file:Main.java

public static void main(String[] args) {
    Date date = new Date();

    String strDate = DateFormat.getDateInstance(DateFormat.LONG).format(date);

    System.out.println(strDate);/*from   w w  w  . j a  v a 2s. c  om*/
}

From source file:Main.java

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

    String s = DateFormat.getTimeInstance(DateFormat.LONG, Locale.CANADA).format(new Date());
    System.out.println(s);/*from w ww  .  j  a  v a 2 s .  c om*/

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault());

    String s = dateFormat.format(new Date());
    System.out.println(s);/*from w  ww .  jav  a  2s . c  o  m*/

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG,
            Locale.getDefault());

    String s = dateFormat.format(new Date());
    System.out.println(s);/*  w  w  w .  jav  a2s  . c o m*/

}

From source file:MainClass.java

public static void main(String[] args) {
    DateFormat shortDf = DateFormat.getDateInstance(DateFormat.SHORT);

    DateFormat mediumDf = DateFormat.getDateInstance(DateFormat.MEDIUM);
    DateFormat longDf = DateFormat.getDateInstance(DateFormat.LONG);
    DateFormat fullDf = DateFormat.getDateInstance(DateFormat.FULL);
    System.out.println(shortDf.format(new Date()));
    System.out.println(mediumDf.format(new Date()));
    System.out.println(longDf.format(new Date()));
    System.out.println(fullDf.format(new Date()));

    // parsing//from ww  w.  j  ava 2 s.  c om
    try {
        Date date = shortDf.parse("Jan 32, 2005");
    } catch (ParseException e) {
    }
}

From source file:MainClass.java

public static void main(String[] args) {
    DateFormat shortDf = DateFormat.getDateInstance(DateFormat.SHORT);

    DateFormat mediumDf = DateFormat.getDateInstance(DateFormat.MEDIUM);
    DateFormat longDf = DateFormat.getDateInstance(DateFormat.LONG);
    DateFormat fullDf = DateFormat.getDateInstance(DateFormat.FULL);
    System.out.println(shortDf.format(new Date()));
    System.out.println(mediumDf.format(new Date()));
    System.out.println(longDf.format(new Date()));
    System.out.println(fullDf.format(new Date()));

    // parsing/*from   w  w  w.  java  2 s.  c o m*/
    try {
        Date date = shortDf.parse("12/12/2006");
    } catch (ParseException e) {
    }
}