Here you can find the source of getDlayDateTime(String playDate, String playTime)
public static String getDlayDateTime(String playDate, String playTime)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static String getDlayDateTime(String playDate, String playTime) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format2 = new SimpleDateFormat("HH:mm:ss"); StringBuffer sb = new StringBuffer(); try {/*from ww w . j ava 2s .c o m*/ playDate = format1.format(format.parse(playDate)); } catch (ParseException e) { e.printStackTrace(); } try { playTime = format2.format(format.parse(playTime)); } catch (ParseException e) { e.printStackTrace(); } sb.append(playDate); sb.append(" "); sb.append(playTime); return sb.toString(); } }