Example usage for java.util Date Date

List of usage examples for java.util Date Date

Introduction

In this page you can find the example usage for java.util Date Date.

Prototype

public Date() 

Source Link

Document

Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

Usage

From source file:Main.java

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

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

}

From source file:Main.java

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

    String s = dateFormat.format(new Date());
    System.out.println(s);/*from  w w w. j  a v a2  s  .co  m*/

}

From source file:Main.java

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

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

}

From source file:Main.java

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

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

}

From source file:MainClass.java

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

    Date date = new Date();
    System.out.printf(Locale.ITALIAN, "The date is %tc\n", date);

}

From source file:MainClass.java

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

    Date date = new Date();
    System.out.printf(Locale.CHINA, "The date is %tc\n", date);

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    SimpleDateFormat formatter = new SimpleDateFormat();

    String date = formatter.format(new Date());
    System.out.println(formatter.getDateFormatSymbols().getLocalPatternChars());
    System.out.println("date = " + date);
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    SimpleDateFormat formatter = new SimpleDateFormat();

    String date = formatter.format(new Date());
    System.out.println(formatter.toLocalizedPattern());
    System.out.println("date = " + date);
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    SimpleDateFormat formatter = new SimpleDateFormat();

    String date = formatter.format(new Date());
    System.out.println(formatter.hashCode());
    System.out.println("date = " + date);
}

From source file:Main.java

public static void main(String args[]) {

    SimpleTimeZone stobj1 = new SimpleTimeZone(820, "GMT");

    // create date
    Date date = new Date();

    // check day light
    boolean daylight = stobj1.inDaylightTime(date);

    // checking the value of day light      
    System.out.println("Is in day light : " + daylight);
}