Java Date Now getNowDateShort()

Here you can find the source of getNowDateShort()

Description

get Now Date Short

License

Open Source License

Declaration

public static Date getNowDateShort() 

Method Source Code

//package com.java2s;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {

    public static Date getNowDateShort() {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(currentTime);
        ParsePosition pos = new ParsePosition(8);
        Date currentTime_2 = formatter.parse(dateString, pos);
        return currentTime_2;
    }/*from w ww. ja va  2  s .co m*/
}

Related

  1. getNowDate()
  2. getNowDate()
  3. getNowDate()
  4. getNowDate(String format)
  5. getNowDate(String format)
  6. getNowDateStr(String formatStr)
  7. getNowDateString(String sign)