Java String to Time getDlayDateTime(String playDate, String playTime)

Here you can find the source of getDlayDateTime(String playDate, String playTime)

Description

get Dlay Date Time

License

Open Source License

Declaration

public static String getDlayDateTime(String playDate, String playTime) 

Method Source Code


//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();
    }
}

Related

  1. getAsDateTime(String dateTime)
  2. getCalendarForSpecifiedDate(final String dateTime)
  3. getCalendarFromCPEGeneratorDateTime(String cpeDateTime)
  4. getCalendarFromDate(final String dateTime)
  5. getEndTime(String flag, int value)
  6. getExecutionDateTime(String input)
  7. getExpireTime(String timeStr)
  8. getFormerDate(String dateTime)