SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd ");
SimpleDateFormat sdf1 =new SimpleDateFormat("HH:mm:ss");
//年月日组合时分秒
public static Timestamp getTime(Timestamp Time1, Time Time3) throws ParseException {
Timestamp Time2=null;
if (Time1 != null) {
String format1 = sdf.format(Time1);
String format2 = sdf1.format(Time3);
Date parse1 = df.parse(format1 + format2);
Time2 = new Timestamp(parse1.getTime());
}
return Time2;
}
java年月日组合时分秒
最新推荐文章于 2024-08-16 10:02:35 发布