Java SQL Date Get getDateStart(Date date)

Here you can find the source of getDateStart(Date date)

Description

get Date Start

License

Open Source License

Declaration

public static Date getDateStart(Date date) 

Method Source Code


//package com.java2s;

import java.util.*;

public class Main {
    public static Date getDateStart(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, (date.getYear() + 1900));
        calendar.set(Calendar.MONTH, date.getMonth());
        calendar.set(Calendar.DATE, date.getDate());
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        return calendar.getTime();
    }//from   www.j a  va2s.c  o m

    public String getDate() {
        java.sql.Date enter = new java.sql.Date(System.currentTimeMillis());
        return enter.toString();
    }

    public String getTime() {
        java.sql.Time ent = new java.sql.Time(System.currentTimeMillis());
        return ent.toString();
    }
}

Related

  1. getDateOfString(long time, String patten)
  2. getDateOrTime(int colType, Object o)
  3. getDateParameter(java.sql.Date date, int param)
  4. getDatePath(java.sql.Timestamp fileDate)
  5. getDatePath(java.util.Date fileDate)
  6. getDateTwo(Date date)
  7. getDateValue(ResultSet result, String strField, String strDateFormat)
  8. getDateValue(ResultSet result, String strField, String strDateFormat)
  9. getDateWithSpecifiedHourAndMinute(Date targetDate, int hour, int minute)