Java SQL Time From getDateTimeRtnTime(Date date, String time)

Here you can find the source of getDateTimeRtnTime(Date date, String time)

Description

get Date Time Rtn Time

License

Open Source License

Declaration

public static Timestamp getDateTimeRtnTime(Date date, String time) 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Timestamp getDateTimeRtnTime(Date date, String time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Timestamp timeStamp = null;
        sdf.setLenient(false);//www  .ja v a2 s  .c  o m
        try {
            String dateStr = sdf.format(date);
            timeStamp = Timestamp.valueOf(dateStr + " " + time);
        } catch (Exception e) {
        }
        return timeStamp;
    }
}

Related

  1. getDateTime(String dateTime)
  2. getDateTime(String s)
  3. getDatetime(String value)
  4. getDateTimeBySecond(long timeMillis)
  5. getDateTimeFormat()
  6. getDateTimeStr(Date date)
  7. getDateTimeString(java.sql.Date dd)
  8. getDateTimeString(String format)
  9. getDateTimeStringFromCalendar(Calendar calendar)