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:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("Time zone abbreviation: %tZ/%TZ\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("one-or-two digit hour on a 24-hour clock: %tk/%Tk\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("two digit hour on a 12-hour clock: %tI/%TI\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("milliseconds: %tL/%TL\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("two digit minutes ranging from 00 to 59: %tH / %TH\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("two digit seconds ranging from 00 to 60 : %tS/%TS\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("localized, abbreviated month: %th/%Th\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("two digit hour on a 24-hour clock: %tH/%TH\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("localized month name: %tB/%TB\n", now, now);
}

From source file:MainClass.java

public static void main(String[] args) {
    Date now = new Date();
    System.out.printf("localized, abbreviated month: %tb/%Tb\n", now, now);
}