Java SQL Date Get getDate()

Here you can find the source of getDate()

Description

get Date

License

Apache License

Declaration

public static Date getDate() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date getDate() {
        return java.sql.Date.valueOf(getFormatDate("yyyy-MM-dd"));
    }//  w w w  . j  ava  2 s.co  m

    public static Date getDate(String date) {
        return java.sql.Date.valueOf(date);
    }

    protected static String getFormatDate(String formatString) {
        String currentDate = "";
        SimpleDateFormat format1 = new SimpleDateFormat(formatString);
        currentDate = format1.format(new Date());
        return currentDate;
    }
}

Related

  1. getDate()
  2. getDate()
  3. getDate()
  4. getDate()
  5. getDate()