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 {

    Format formatter = new SimpleDateFormat("H");
    String s = formatter.format(new Date());
    System.out.println(s);//from  w  w  w.j a  v a 2  s. com
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("E");
    String s = formatter.format(new Date());
    System.out.println(s);//from   w w  w . j  a  v a  2 s .c  o m
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("m");
    String s = formatter.format(new Date());
    System.out.println(s);/*from  ww w.j  a va 2s . com*/
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("M");
    String s = formatter.format(new Date());
    System.out.println(s);//from  ww w . j  a v a 2  s  . com
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("Z");
    String s = formatter.format(new Date());
    System.out.println(s);// www .j  a va 2s.c om
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("s");
    String s = formatter.format(new Date());
    System.out.println(s);/* w w  w.j  ava 2s  .  c  o m*/
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("a");
    String s = formatter.format(new Date());
    System.out.println(s);//from   ww  w  .jav a2 s .co m
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("d");
    String s = formatter.format(new Date());
    System.out.println(s);/*  w  ww. j a va 2  s.c  om*/
}

From source file:Main.java

public static void main(String[] args) {
    File file = new File("C:/ReadText.txt");
    System.out.println(file.lastModified());

    System.out.println(file.setLastModified(new Date().getTime()));
    System.out.println(new Date(file.lastModified()));
}

From source file:Main.java

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

    Format formatter = new SimpleDateFormat("mm");
    String s = formatter.format(new Date());
    System.out.println(s);//from   w w w  .  j  a va  2 s . c  o m
}