Java Date Create date()

Here you can find the source of date()

Description

date

License

Open Source License

Declaration

public static String date() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Date;

import java.util.Calendar;

public class Main {
    final static String DATE_FORMAT = "%tH:%<tM:%<tS.%<tL";
    private static int timeOffset = 0;

    public static String date() {
        return String.format(DATE_FORMAT, getDate());
    }/*from ww  w  .  j ava2 s  .c  om*/

    private static Date getDate() {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.MILLISECOND, timeOffset);
        return cal.getTime();
    }
}

Related

  1. createDateTime(int year, int month, int day, int hour, int minute, int second, String timezone)
  2. createFutureDate()
  3. createFutureDate(int min)
  4. createInitialDateQuery(final Date date)
  5. createTime(Date date)
  6. date(Date d)
  7. date(final int year, final int month, final int dayOfMonth)
  8. date(int day, int month, int year)
  9. date(int y, int m, int d)